Redirect multiple domains to the same website

Over the last couple of years, I aquired a nice collection of various domains. Since I only keep them for historical purposes, I decided to redirect all domains to this blog domain. Usually, you can achieve such a redirection by simply pointing all your domains to the same virtual host within your webserver configuration in case you are using WordPress. However, this won’t work when using some caching plugins. Some .htaccess magic will help though.

The following .htaccess snippet redirects every domain that’s not called to the – well – desired target domain:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^
RewriteRule (.*)$1 [R=permanent,QSA,L]

The redirection also works for all queries – will always redirect to

Leave a Reply

Your email address will not be published.