[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Apache replaces ip-address with (local) hostname



Ronald Capel <b.fly.spam.1@hccnet.nl> writes:
> 
> I am having a problem with my Apache server at home. Everything is
> working fine when I access the webpages from the intranet. The
> problem occurs when trying to access the pages from the internet.

What's happening is that Apache automatically generates redirects in
some circumstances.  One important case is where you specify a URL
like:

        http://10.0.0.1/a/directory

without the trailing slash.  Apache normally redirects this to:

        http://<value-of-ServerName>/a/directory/

So, the ServerName solution that nate mentioned---using the IP
address---should fix the problem.  A nice alternative might be to
change the:

        UseCanonicalName on

setting in "httpd.conf" to "off".  Then, whenever Apache is generating
an absolute URL to refer back to itself (like for those redirects), it
will try to the use the hostname provided by the client (which will be
the IP address when you're connecting from the big, bag Internet)
instead of the ServerName.

-- 
Kevin <buhr@telus.net>



Reply to: