Guest User

Untitled

a guest
Oct 18th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. Options All -Indexes
  2.  
  3. <Files .htaccess>
  4. Order allow,deny
  5. Deny from all
  6. </Files>
  7.  
  8. <IfModule mod_rewrite.c>
  9. RewriteEngine On
  10. RewriteBase /
  11.  
  12. #www to non www
  13. RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
  14. RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
  15.  
  16. #https on
  17. RewriteCond %{HTTPS} off
  18. RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  19.  
  20. #redirect index.html to main folder
  21. RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /index.(php|html|htm) HTTP/
  22. RewriteRule ^(.*)index.(php|html|htm)$ $1 [R=301,L]
  23.  
  24. #remove "/"
  25. RewriteCond %{HTTP_HOST} (.*)
  26. RewriteCond %{REQUEST_URI} /$ [NC]
  27. RewriteRule ^(.*)(/)$ $1 [L,R=301]
  28.  
  29. #example.com/page will display the contents of example.com/page.html
  30. RewriteCond %{REQUEST_FILENAME} !-f
  31. RewriteCond %{REQUEST_FILENAME} !-d
  32. RewriteCond %{REQUEST_FILENAME}.html -f
  33. RewriteRule ^(.+)$ $1.html [L,QSA]
  34. RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /.*.html HTTP/
  35. RewriteRule ^(.*).html$ /$1 [R=301,L]
  36. </IfModule>
Add Comment
Please, Sign In to add comment