httpd

Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

Under certain circumstances, Apache has to determine its own name. To do that, it uses a combination of several directives, namely ServerName and UseCanonicalName. If ServerName is not set explicitly in the Apache config file, Apache uses reverse DNS lookup to determine the ServerName. The error above, however, indicates that reverse DNS lookup on server's IP failed, too. In one particular case, the error was caused by an incorrect /etc/hosts file:

127.0.0.1   localhost   localhost.localdomain   nastage2

Correct format is as follows:

127.0.0.1   localhost.localdomain localhost nastage2

mod_rewrite trickery

Redirect to another host, preserving the query string

RewriteEngine On
RewriteMap unescape int:unescape
RewriteRule ^/devel/app.*$ http://example.com/app/?${unescape:%{QUERY_STRING}} [R]