I installed a LAMP server and set up my domain name to resolve to an appropriate IP address. However, when I connect to a server with it's domain name, it is with an IP address in an address bar. My /etc/apache2/sites-available/default looks like this:

NameVirtualHost *:80

<VirtualHost *:80>
        ServerAdmin ...
        ServerName mydomainname.irrelevant.to.the.question

        DocumentRoot /var/www
...

I thought that was supposed to fix this behaviour. What else is required?

link|improve this question

75% accept rate
Sounds like you have some 3xx redirect somewhere. Please check your Redirect/RedirectMatch/RewriteRule directives. – LazyOne Sep 2 '11 at 11:15
feedback

1 Answer

It's likely your PHP application.

Apache won't bother with this kind of redirection without being specifically told to with a Redirect or RewriteRule doing it (it doesn't "enforce" matching of the ServerName in any way), but a lot of web applications out there in the world like for the requested hostname to match what they're internally configured with.

link|improve this answer
actually, server does this thing even when it's not in the application's sphere of influence. Specifically, application in question is redmine, it's accessible under (in example) server.address/redmine, but the address string is replaced both if we go to server.address/redmine and server.address (where a stock apache "It works!" is displayed for now). – Septagram Sep 3 '11 at 8:19
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.