Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RewriteEngine On
- RewriteCond %{http_host} ^example.com [NC]
- RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]
- RewriteCond %{HTTPS} off
- RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
- #1)externally redirect "/file.htm" to "/file"
- RewriteCond %{THE_REQUEST} /([^.]+)\.htm [NC]
- RewriteRule ^ /%1 [NC,L,R=301]
- #2)Internally map "/file" back to "/file.htm"
- RewriteCond %{REQUEST_FILENAME}.htm -f
- RewriteRule ^(.*?)/?$ /$1.htm [NC,L]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement