Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Options +SymLinksIfOwnerMatch
- RewriteEngine On
- RewriteBase /
- # Ensure www on all URLs.
- RewriteCond %{HTTP_HOST} !^www. [NC]
- RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [L,R=302]
- # Ensure we are using HTTPS version of the site.
- RewriteCond %{HTTPS} !on
- RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=302]
- RewriteCond %{THE_REQUEST} s/*(.*?)/index.php [NC]
- RewriteRule ^ %1/ [R=302,L]
- RewriteCond %{THE_REQUEST} s/+(.+?).php[s?] [NC]
- RewriteRule ^ /%1/ [R=302,L]
- # Ensure all URLs have a trailing slash.
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteRule ^[^.]*?[^/.]$ %{REQUEST_URI}/ [L,R=302]
- # Remove all .php extensions without interfering with .js or .css.
- RewriteCond %{REQUEST_FILENAME}.php -f
- RewriteRule ^([^.]+?)/?$ $1.php [L]
- mysite.com - index.php
- - communications.php
- /php/ all php files here
- /js/ all js and jquery files here
- /css/ all css files here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement