For all pages in my codeigniter app except my default controller, main.php, when I refresh the browser the url isn’t affected as one would expect.
However when I refresh the browser at “http://localhost/main”, the main part is stripped off the url. So the browser bar shows just “http://localhost”.
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;
}
Note that changing the bracketed code to this:
rewrite ^(.*)$ /main permanent;
results in the error message The webpage at http://localhost/main has resulted in too many redirects.
Ok I answered my own question. Simply commenting out the nginx.conf code that I showed corrects the problem.
So just do this (says Bo Jackson):