Welcome Guest, Not a member yet? Register   Sign In
SOLUTION for removing index.php in web servers
#1
Big Grin 

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
Reply




Theme © iAndrew 2016 - Forum software by © MyBB