Skip to main content

Posts

Showing posts from March, 2016

Remove index.php from CodeIgniter's URL

I've seen plenty of write-ups on how to remove index.php from your URL. What these write-ups don't seem to account for is if you're working on a WAMP server. So here are the steps to remove index.php using .htaccess Step 1 Open application/config.php $config [ 'index_page' ] = "index.php" needs to be $config [ 'index_page' ] = "" You may also have to change $config [ 'uri_protocol' ] = "AUTO" to $config [ 'uri_protocol' ] = "REQUEST_URI" You might also have to clear your base_url $config [ 'base_url' ] = "" Step 2 Create a .htaccess file in your CodeIgniter root directory (the directory where you see your application, assets, system folders and add the following code to your .htaccess file: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond % { REQUEST_FILENAME } ! - f RewriteCond % { REQUEST_FILENAME } ! - d RewriteRule ^ ( . * ) $ index .