Welcome Guest, Not a member yet? Register   Sign In
htaccess for removing index.php
#1

This is not a question - it's a tip.

There are many folks out there puzzled because the htaccess file supplied at the root of CI does not remove index.php from the URL. They've checked that mod_rewrite is on and that Allow overrides is on for their root, but still no joy. Lots of conflicting advice on Stackoverflow and the like. I tried it on three different Apache setups: at home it worked, at hosting provider A it worked, but at hosting provider B it did not.

Fortunately hosting provider B had a very smart support person who told me the fix.

The re-write rule supplied by CI is this : RewriteRule ^(.*)$ index.php/$1 [L]
The one that works on all Apache servers is this: RewriteRule ^(.*)$ index.php?/$1 [L]
Notice the ? at the end of index.php

It's backwards compatible - the new rule works on all the machines I tested it on.

So I'd like to suggest that the CI folks change the documentation for "Removing the index.php file"

Hope this will help someone

KT
Reply


Messages In This Thread
htaccess for removing index.php - by sackbut - 04-09-2015, 08:56 AM
RE: htaccess for removing index.php - by gadelat - 04-09-2015, 09:05 AM
RE: htaccess for removing index.php - by InsiteFX - 04-10-2015, 03:38 AM
RE: htaccess for removing index.php - by sackbut - 04-19-2015, 05:11 AM
RE: htaccess for removing index.php - by alkarim - 04-16-2015, 02:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB