Welcome Guest, Not a member yet? Register   Sign In
How to remove index.php in url?
#1

#2

[eluser]Bhashkar Yadav[/eluser]
Go to application/config/config.php

Update code
Code:
$config['index_page'] = 'index.php';
with
Quote:$config['index_page'] = '';
around line number 29.

Create .htaccess file with
Code:
# .htaccess file
RewriteEngine On
# Removes index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
#3

[eluser]Matteo[/eluser]
Great reply, just 1 question...

Do you replace the .htaccess file in the CI/system folder or somewhere else? The one in the CI folder just says "deny from all". I don't want to screw anything up.
#4

[eluser]CroNiX[/eluser]
No, don't touch the .htaccess in /system or /application. Those directories are not supposed to be accessed via the url, which is why those rules are there.

You need to create a new .htaccess and it should be located in the same directory that index.php is located.

This is also covered in the User Guide, although their sample .htaccess is a bit of an older version (it should still work ok).
#5

[eluser]timpiele[/eluser]
I have done both of these things but I still get the error:


***********************************************************************

Not Found

The requested URL /index.php/engines was not found on this server.

Apache/2.2.3 (CentOS) Server

***********************************************************************



If I go to : /index.php/engines I can see the page.




Theme © iAndrew 2016 - Forum software by © MyBB