Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /
- ·--index.php
- |
- ·--/about-us/
- | |
- | ·--index.php
- ·--/contact-us/
- |
- ·--index.php
- # Options
- Options +FollowSymLinks -MultiViews -Indexes
- DirectoryIndex index.php index.html
- DirectorySlash off
- # Enable Rewrite Engine
- RewriteEngine on
- RewriteBase /
- # www to non-www
- RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
- RewriteCond %1##%{HTTPS}s ^(.+)##(?:on(s)|)
- RewriteRule ^ http%2://%1%{REQUEST_URI} [L,R=301,NE]
- # remove trailing slash from all URLs
- RewriteCond %{THE_REQUEST} s(.+?)/+[?s]
- RewriteRule ^(.+)/$ /$1 [R=301,L,NE]
- # To externally redirect /dir/file.php to /dir/file
- RewriteCond %{THE_REQUEST} s/+(.+?).php[s?] [NC]
- RewriteRule ^ /%1 [R=301,NE,L]
- # internally add trailing / to directories
- RewriteCond %{REQUEST_FILENAME} -d
- RewriteRule !/$ %{REQUEST_URI}/ [L]
- # To internally forward /dir/file to /dir/file.php
- RewriteCond %{DOCUMENT_ROOT}/$1.php -f [NC]
- RewriteRule ^(.+?)/?$ $1.php [L]
- <FilesMatch ^.>
- order allow,deny
- deny from all
- </FilesMatch>
- <Files *.inc>
- order allow,deny
- deny from all
- </Files>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement