How to remove index.php from CI URL?
- Open
application/config/config.php file. Find following statement in this file.
$config[‘index_page’] = ‘index.php’; - And remove index.php from above statement, this will look like following.
$config[‘index_page’] = ”; - Create .htaccess file in application directory and paste following statements in it.
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / #if you are working on localhost then above statement will be RewriteBase /<your_path> RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] <IfModule>
- Make sure you have mod_rewrite is activated. If not; then visit How to activate mod_rewrite.
Want to get PHP Application Development Service, then hire me at OutsourceUrDesign