Remove index.php from url in codeigniter

From the morning itself i tried in different ways to remove index.php from the url in codeigniter architecture.

Neither ways from all sources in youtube nor some other sites helped me. But finally i got solution & its working well now.

Steps:

1.activate curl extension in php.ini

2.in apache folder->conf->httpd.conf->

remove # from LoadModule rewrite_module modules/mod_rewrite.so

then after search for “Allowoverride” and keep like this AllowOverride All

3. goto root directory of your project..applications->cut .htaccess file from there and copy to root folder(wamp/www/ci/) paste here. Open that htaccess file & edit with this following code:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

4. Navigate to wamp/www/ci/application/config/config.php

modify this $config[‘index_page’] = ‘index.php’; to $config[‘index_page’] = ”;

and add url in $config[‘base_url’] = ‘your url’;

Simple..now you can work your project without using index.php in url. Enjoy 😉

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s