CodeIgniter Forums

Full Version: remove index.php from url
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How  can i remove index.php from url
(03-05-2018, 04:59 AM)jyoti sudyal Wrote: [ -> ]How  can i remove index.php from url

https://www.codeigniter.com/user_guide/g...x-php-file
"https://www.codeigniter.com/user_guide/g...x-php-file"
i have tried this already but its not working at my end.
The thread was started in the CI2 subforum, suggesting that the answer might be in https://www.codeigniter.com/userguide2/g.../urls.html
As i mentioned above i have tried this already but this is not working for me.


.htaccess file ::

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]


config file ::
$config['index_page'] = 'index.php';
$config['uri_protocol'] = 'REQUEST_URI';
If your Apache server has mod_rewrite enabled, you can easily remove this file by using a .htaccess file with some simple rules. Here is an example of such a file, using the “negative” method in which everything is redirected except the specified items:


RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Same situation happens to me. I have change the code in htaccess file.
Please check with this. Hope it will work for you also.

If it is not work check Please let us know your url is a Https or Http.
mod_rewrite is enabled by default on godaddy's server and my url is http.