Categories
apache

.htaccess Forward to New Domain with URL Parameters

If you move your web page to a new domain, you may want to forward users (and search engines in particular) that still access your page via the old domain to the new domain. However, if you use an underlying CMS or blog system you will want to keep the parameters after the domain name. E.g., if someone called http://olddomain.com/lang/en-us/living-with-complexity you would want to forward it to http://newddomain.com/lang/en-us/living-with-complexity. For this purpose, I found the following .htaccess snippet handy: