How do I redirect/rewrite to the FQDN URL without setting ServerName?
- by ChaimKut
Often in intranets, users will direct URLs to a hostname without supplying the FQDN. Example:
http://internalHost
Instead of
http://internalHost.example.com
I would like to redirect users / rewrite URLs so that everything will use the FQDN. Here's the catch: I don't want to set ServerName explicitly. (This is for a product which will be deployed in multiple intranets so we can't know the value of ServerName ahead of time).
According to: http://wiki.apache.org/httpd/CouldNotDetermineServerName Apache uses a reverse lookup to determine a default FQDN.
How can I make use of/reference that FQDN that Apache is using for a mod_rewrite or redirect?