Skip to content

Instantly share code, notes, and snippets.

@UltraSimplified
Last active August 29, 2016 11:12
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save UltraSimplified/7316293 to your computer and use it in GitHub Desktop.
Save UltraSimplified/7316293 to your computer and use it in GitHub Desktop.
Custom .htaccess for use on Gandi.net with Codeigniter hiding index.php Varnish temporarily disabled (for development) see http://blog.ultrasimplified.com/fixing-codeigniter-paths-with-htaccess-on-gandi-net/ for more information
# temporarily disable Varnish
# to make it easier to test changes
Header add Cache-Control "max-age=1"
RewriteEngine On
# Existing files and directories remain accessible
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.* - [L]
# Redirect the rest
RewriteCond $1 !^(index\.php|public|assets|robots\.txt)
RewriteRule ^(.*)$ /index.php?/$1 [QSA,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment