.htaccess 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Disable directory browsing
  2. Options All -Indexes
  3. # ----------------------------------------------------------------------
  4. # Rewrite engine
  5. # ----------------------------------------------------------------------
  6. # Turning on the rewrite engine is necessary for the following rules and features.
  7. # FollowSymLinks must be enabled for this to work.
  8. <IfModule mod_rewrite.c>
  9. Options +FollowSymlinks
  10. RewriteEngine On
  11. # If you installed CodeIgniter in a subfolder, you will need to
  12. # change the following line to match the subfolder you need.
  13. # http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
  14. # RewriteBase /
  15. #Deny from 127.0.0.1
  16. #above seems to work locally
  17. # Redirect Trailing Slashes...
  18. RewriteCond %{REQUEST_FILENAME} !-d
  19. RewriteRule ^(.*)/$ /$1 [L,R=301]
  20. # Rewrite "www.example.com -> example.com"
  21. RewriteCond %{HTTPS} !=on
  22. RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  23. RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
  24. #change above to below for https according to forum
  25. #RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]
  26. # Checks to see if the user is attempting to access a valid file,
  27. # such as an image or css document, if this isn't true it sends the
  28. # request to the front controller, index.php
  29. RewriteCond %{REQUEST_FILENAME} !-f
  30. RewriteCond %{REQUEST_FILENAME} !-d
  31. RewriteRule ^(.*)$ index.php/$1 [L]
  32. # Ensure Authorization header is passed along
  33. RewriteCond %{HTTP:Authorization} .
  34. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  35. </IfModule>
  36. <IfModule !mod_rewrite.c>
  37. # If we don't have mod_rewrite installed, all 404's
  38. # can be sent to index.php, and everything works as normal.
  39. ErrorDocument 404 index.php
  40. </IfModule>
  41. # Disable server signature start
  42. ServerSignature Off
  43. # Disable server signature end
  44. SetEnv CI_ENVIRONMENT production