Skip to content

Instantly share code, notes, and snippets.

@nicksheffield
Last active December 21, 2015 16:59
Show Gist options
  • Save nicksheffield/6337669 to your computer and use it in GitHub Desktop.
Save nicksheffield/6337669 to your computer and use it in GitHub Desktop.
Basic codeigniter .htaccess
<Files .htaccess>
order allow,deny
deny from all
</Files>
RewriteEngine on
# Don't use rewrite if its a real file or folder
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# In addition to the above rules, also ignore the index.php
# file, anything in the assets folder and the robots.txt file
RewriteCond $1 !^(index\.php|assets|robots\.txt)
# Route everything else through the index.php file.
RewriteRule ^(.*)$ index.php?/$1 [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment