Advertisement
Guest User

Untitled

a guest
Sep 10th, 2019
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. RewriteEngine On
  2. RewriteCond %{http_host} ^example.com [NC]
  3. RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]
  4.  
  5. RewriteCond %{HTTPS} off
  6. RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  7.  
  8. #1)externally redirect "/file.htm" to "/file"
  9. RewriteCond %{THE_REQUEST} /([^.]+)\.htm [NC]
  10. RewriteRule ^ /%1 [NC,L,R=301]
  11. #2)Internally map "/file" back to "/file.htm"
  12. RewriteCond %{REQUEST_FILENAME}.htm -f
  13. RewriteRule ^(.*?)/?$ /$1.htm [NC,L]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement