Sunday 2 October 2016

How to remove 'index.php' from URL in Codeigniter?

Step 1 :
Make some changes in config.php file Go to “your-project-or-domain/application/config/config.php”
 You will find there below code.
  1. $config['index_page'] = 'index.php';
  2. //Replace above code with below code
  3. $config['index_page'] = '';
Add following rules in your .htaccess file on root directory.
  1. RewriteEngine on
  2. RewriteBase /your-project-directory-name/
  3. RewriteCond $1 !^(index.php|resources|robots.txt)
  4. RewriteCond %{REQUEST_FILENAME} !-f
  5. RewriteCond %{REQUEST_FILENAME} !-d
  6. RewriteRule ^(.*)$ index.php/$1 [L,QSA]
It’s done but If you face still there is an issue then you need to change one more configuration in config.php file.
 You need to find below code
  1. $config['uri_protocol'] = 'AUTO';
  2. //Replace above code with below code
  3. $config['uri_protocol'] = 'REQUEST_URI';

No comments:

Post a Comment

Installation of Drop Box API on Codigniter

As with the YouTube API the first step in getting this sucker setup is getting a developer key by visiting  https://www.dropbox.com/develop...