Send to a Friend

haegenschlatt's avatar

Why does my server always redirect to localhost when I visit a subdirectory on the server?

Asked by haegenschlatt (122points) October 2nd, 2010

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.

Using Fluther

or

Using Email

Separate multiple emails with commas.
We’ll only use these emails for this message.