Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Options All -Indexes
- <Files .htaccess>
- Order allow,deny
- Deny from all
- </Files>
- <IfModule mod_rewrite.c>
- RewriteEngine On
- RewriteBase /
- #www to non www
- RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
- RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
- #https on
- RewriteCond %{HTTPS} off
- RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
- #redirect index.html to main folder
- RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /index.(php|html|htm) HTTP/
- RewriteRule ^(.*)index.(php|html|htm)$ $1 [R=301,L]
- #remove "/"
- RewriteCond %{HTTP_HOST} (.*)
- RewriteCond %{REQUEST_URI} /$ [NC]
- RewriteRule ^(.*)(/)$ $1 [L,R=301]
- #example.com/page will display the contents of example.com/page.html
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond %{REQUEST_FILENAME}.html -f
- RewriteRule ^(.+)$ $1.html [L,QSA]
- RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /.*.html HTTP/
- RewriteRule ^(.*).html$ /$1 [R=301,L]
- </IfModule>
Add Comment
Please, Sign In to add comment