Welcome Guest, Not a member yet? Register   Sign In
htaccess remove index.php rule not correct
#1

looking at ci-3 documentation for removing the need for the index.php in the URL, I don't think the rule is correct.

Documentation page with bad-rule: 
https://www.codeigniter.com/userguide3/g...x-php-file 

the rule shown is (bad-rule)RewriteRule ^(.*)$ index.php/$1 [L]    
It should: (good-rule)     : RewriteRule ^(.*)$ index.php?/$1 [L]  

I found the good-rule here: http://stackoverflow.com/questions/20169...p-problems

For some reason bad-rule worked locally on an xamp server but when I uploaded to live site it failed. The good-rule works in both locations.  

Please update the documentation.
I hope this helps somebody.                
Reply
#2

I could be mistaken, but wouldn't the question mark in your rule apply only to query parameters, as opposed to segment based routing?

Disclaimer: IANAL, nor am I an htaccess wizard.
Reply
#3

good thought ciadmin

I also am not an htaccess wizard. Apparently the rule is some kind of regEx. I don't understand it.

I just reconfirmed the change.
Removed the question mark and got;
"No input file specified."
Put the question mark back and the site is working fine.

Not sure why but it worked for me.

Thanks
Reply
#4

The question sign has been commented already, search the forum archive.
Reply
#5

Searched forum; 
Found at least these two that seem to support having question mark in the htaccess rule.
http://forum.codeigniter.com/thread-1014...stion+mark
http://forum.codeigniter.com/thread-1514...stion+mark

Seems myself and others have more success with the question mark added.

Thanks
Reply
#6

? = fastcgi server
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB