Why does my server always redirect to localhost when I visit a subdirectory on the server?
System admins and Linux gurus, here’s one for you:
I’m a bit of a newbie at this. I installed nginx on a server that originally ran apache2. I tested out nginx and found that going to the server’s address worked fine, but whenever I went to http://serverip/folder it would redirect to http://localhost/folder and because I had nothing running on localhost, it would give me a 404 error.
I decided that I would try nginx at a later date and uninstalled it using apt-get—purge remove nginx and switched back to apache2.
When I started up apache2 I discovered that it had the same problem as well.
Yes, I have checked the hosts file on my machine, and on the server.
Yes, I made sure there was only one server daemon running at a time.
Yes, I have Googled it.
Can anybody help? I’m more than happy to provide my config files if you need them.
This question is in the General Section. Responses must be helpful and on-topic.