Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AddDefaultCharset utf-8
- Options +FollowSymLinks -Indexes
- DirectorySlash Off
- <IfModule mod_rewrite.c>
- RewriteEngine On
- RewriteBase /
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond %{REQUEST_URI} (.+)/$
- RewriteRule ^(.*)$ /$1 [R=301,L]
- RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
- RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond %{THE_REQUEST} ^GET /[^?s]+.html
- RewriteRule (.*).html$ /$1 [L,R=301]
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule (.*)/$ $1.html [L]
- # Remove trailing slash:
- RewriteRule (.*)/$ $1 [L,R=301]
- # Now test without the trailing slash:
- RewriteCond %{REQUEST_FILENAME}.html -f
- RewriteRule . %{REQUEST_FILENAME}.html [QSA,L]
- RewriteRule ^(.*)index.(html?)$ /$1 [R=301,NC,L]
- </IfModule>
- <Files .htaccess>
- order allow,deny
- deny from all
- </Files>
- ErrorDocument 404 /404.html
- ErrorDocument 403 /404.html
Add Comment
Please, Sign In to add comment