Default controller name is removed on browser refresh (CodeigniterPHP/Nginx issue?)
- by tim peterson
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;
}