In order to redirect all requests from redirecting-host.com
to desired-host.com
while keeping path and query params unchanged, change your Apache VHost to something like this:
ServerName desired-host.com
ServerAlias redirecting-host.com
RewriteEngine On
RewriteCond %{HTTP_HOST} !^desired-host.com$
RewriteRule ^.*$ http://desired-host.com%{REQUEST_URI} [R=301,L]
Take care to keep all those ^
, $
and !
as seen in the example.
Posted by Henning Koch to makandra dev (2010-12-20 18:30)