Skip to content

Instantly share code, notes, and snippets.

@k0d3r
Created July 11, 2012 21:29
Show Gist options
  • Save k0d3r/3093703 to your computer and use it in GitHub Desktop.
Save k0d3r/3093703 to your computer and use it in GitHub Desktop.
CodeIgniter .htaccess
# Display PHP errors
php_flag display_errors On
# Enable the rewrite engine
RewriteEngine On
# Inherit the rules from the core .htaccess
RewriteOptions Inherit
#------------------------------------
# CodeIgniter Rewrite Rules
#------------------------------------
RewriteBase /
# Prevent access to the system and application directories
RewriteCond %{REQUEST_URI} ^system.*
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php/$1 [L]
# If the user is not attempting an existing file or directory send the request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment