Skip to content

Server URL problems

Derek Jones edited this page Jul 5, 2012 · 10 revisions

As explained in the Troubleshooting section in the User Guide, CI requires the PATH INFO server variable in order for it's segment based system to work (http://www.codeigniter.com/user_guide/installation/troubleshooting.html) The User Guide suggests a number of fixes, and personally I found the only option was to use to append the '?' to my index_page. I wasn't satisfied with this so I did some further investigation and it turns out that my host did support PATH INFO however it was being rejected - the solution - set the AcceptPathInfo directive to 'On' in a htaccess file:

HTACCESS

Allow path info for index.php

<FilesMatch "^index.php$"> SetHandler application/x-httpd-php #always a good idea to confirm type AcceptPathInfo On

// index.php <?php echo $_SERVER [ 'PATH_INFO' ] ; die(); //outputs '/my/path/info' ?>

You see, some servers (such as the one i am hosted on) have this set to 'default' which often rejects path info - often when PHP is run as CGI module I have been told

NB: This can be added to the same htaccess file as the mod_rewrite used to remove the index.php file


If you're still having problems after doing the above, filename case-sensitivity may be the issue. My dev machine uses OSX any my CI program was working fine, but it wasn't working on the production box, which is on a Dreamhost shared server. Changing all filenames to be lowercase seemed to fix the issue.

[I'm a bit of noob to CI, so somebody chime in if there's something more]

Clone this wiki locally