Skip to content

Instantly share code, notes, and snippets.

@afelicioni
Created October 15, 2015 16:50
Show Gist options
  • Save afelicioni/42e0a6b5666e8e633c6a to your computer and use it in GitHub Desktop.
Save afelicioni/42e0a6b5666e8e633c6a to your computer and use it in GitHub Desktop.
codeigniter .htaccess
# hints: https://ellislab.com/codeigniter/user-guide/general/urls.html
<IfModule mod_rewrite.c>
RewriteEngine on
# installed on subfolder? uncomment the following
# RewriteBase /ci/
RewriteBase /
# no direct access for /system folder
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
# no direct access for /application folder
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
# no existing file requested? CI front controller will handle it
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# no mod_rewrite support? let front controller handle the game
ErrorDocument 404 /index.php
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment