CodeIgniter Forums

Full Version: SOLUTION for removing index.php in web servers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Almost everybody wants to remove the index.php from the URL.
The codeigniter documentation says that we have to add this code in the .htaccess file at the root of our project.

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

BUT, some people has problems when they upload the project in a web server, while it works perfect in local.  Huh
The solution is very simple. add a ? after index.php, and it will work!  Big Grin

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

I hope it helps!  Rolleyes

By the way, some servers need to add RewriteBase. In that case, add it just after RewriteEngine On