htaccess remove index.php rule not correct |
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.
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.
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
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
? = fastcgi server
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |