Default controller name is removed on browser refresh (CodeigniterPHP/Nginx issue?)

Posted by tim peterson on Stack Overflow See other posts from Stack Overflow or by tim peterson
Published on 2012-12-17T22:55:24Z Indexed on 2012/12/17 23:03 UTC
Read the original article Hit count: 217

Filed under:
|
|

For all pages in my codeigniter app except my default controller, when I refresh the browser the url isn't affected as one would expect.

However for my default controller, main.php, when when I refresh the browser at "http://localhost/main" or "http://mysite.com/main", the main part is stripped off the url. So the browser bar shows just "http://localhost" or "http://mysite.com".

Totally lost on where to start with this but was just wondering if anyone has come across this before...?

Here's what I think could be the relevant part of my nginx.conf (if Nginx is the problem).

if ($request_uri ~* ^(/main(/index)?|/index(.php)?)/?$)
{
    rewrite ^(.*)$ / permanent;
}

© Stack Overflow or respective owner

Related posts about php

Related posts about codeigniter