Skip to content →

How to redirect http requests to a virtual host

In the contex of redirecting I saw some jaw-dropping configuration in regards to proxying to a physical path. System engineers tried to redirect on a virtual host from the root to a given path “wp”. I assume that was WordPress.

Why would one do something like this?

ProxyPass /
ProxyPassReverse /

I think it’s the misconception of how one should configure a server in Apache.

Apache Web Server document root adaption

This will route any traffic from the website, let’s say to your local server. But the hostname should be part of the “ServerName” attribute. So, you just trimmed that essential attribute. Your request will run no-where, unless the IP is mapped to the exact same directory.

Anyhow, simply extend the path of the document root. In this case with “wp”.  There is no ProxyPass needed.

DocumentRoot "/var/www/vhosts/"

Published in Uncategorized


Leave a Reply

Your email address will not be published. Required fields are marked *