Skip to content

Instantly share code, notes, and snippets.

@moeinrahimi
Created July 28, 2016 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moeinrahimi/6edda0a0449fe4f66074de6bbaa355df to your computer and use it in GitHub Desktop.
Save moeinrahimi/6edda0a0449fe4f66074de6bbaa355df to your computer and use it in GitHub Desktop.
Removing index.php from url in your codeigniter project

First of all make sure to remove index.php from $config['index_page'] = ''; in your config.php then turn on readwrite_mode and add this to your htaccess file

    RewriteEngine on
    RewriteBase /
    # Hide the application and system directories by redirecting the request to index.php
    RewriteRule ^(application|system|\.svn) index.php/$1 [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment