Skip to content

Instantly share code, notes, and snippets.

@onubadev
Created March 1, 2016 14:15
Show Gist options
  • Save onubadev/f4866d99109cccb8d020 to your computer and use it in GitHub Desktop.
Save onubadev/f4866d99109cccb8d020 to your computer and use it in GitHub Desktop.
CI: remove index.php from URLs
# Aditionally set the $config['index_page'] var in config file to blank
# so you avoid the index.php in URL helper functions like site_url() or base_url()
DirectoryIndex index.php
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment