Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. Options +SymLinksIfOwnerMatch
  2. RewriteEngine On
  3. RewriteBase /
  4.  
  5. # Ensure www on all URLs.
  6. RewriteCond %{HTTP_HOST} !^www. [NC]
  7. RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [L,R=302]
  8.  
  9. # Ensure we are using HTTPS version of the site.
  10. RewriteCond %{HTTPS} !on
  11. RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=302]
  12.  
  13. RewriteCond %{THE_REQUEST} s/*(.*?)/index.php [NC]
  14. RewriteRule ^ %1/ [R=302,L]
  15.  
  16. RewriteCond %{THE_REQUEST} s/+(.+?).php[s?] [NC]
  17. RewriteRule ^ /%1/ [R=302,L]
  18.  
  19. # Ensure all URLs have a trailing slash.
  20. RewriteCond %{REQUEST_FILENAME} !-f
  21. RewriteRule ^[^.]*?[^/.]$ %{REQUEST_URI}/ [L,R=302]
  22.  
  23. # Remove all .php extensions without interfering with .js or .css.
  24. RewriteCond %{REQUEST_FILENAME}.php -f
  25. RewriteRule ^([^.]+?)/?$ $1.php [L]
  26.  
  27. mysite.com - index.php
  28. - communications.php
  29. /php/ all php files here
  30. /js/ all js and jquery files here
  31. /css/ all css files here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement