CodeIgniter Starter .htaccess

/ Published in: Apache
Save to your folder(s)

Copy this code and paste it in your HTML
  1. ### Turn on Rewrite Engine to remove index.php from URL
  2. <IfModule mod_rewrite.c>
  3. Options +FollowSymLinks
  4. RewriteEngine On
  5. RewriteBase /
  7. #Removes access to the system folder by users.
  8. #Additionally this will allow you to create a System.php controller,
  9. #previously this would not have been possible.
  10. #'system' can be replaced if you have renamed your system folder.
  11. RewriteCond %{REQUEST_URI} ^system.*
  12. RewriteRule ^(.*)$ /index.php/$1 [L]
  14. #Checks to see if the user is attempting to access a valid file,
  15. #such as an image or css document, if this isn't true it sends the
  16. #request to index.php
  17. RewriteCond %{REQUEST_FILENAME} !-f
  18. RewriteCond %{REQUEST_FILENAME} !-d
  19. RewriteRule ^(.*)$ index.php/$1 [L]
  21. # Force www. in the domain name.
  22. # RewriteCond %{HTTP_HOST} !^$
  23. # RewriteRule ^(.*)$$1 [R=301]
  25. </IfModule>

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.