Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to rewrite a domain to another domain and add get parameters using Apache's mod_rewrite, redirect or similar.


www.domain.com -> www.otherdomain.com/?param1=value1&param2=value2

Can this be done?

I've been testing with the following without success:

Redirect www.domain.com  http://www.otherdomain.com?param1=value1&param2=value2
share|improve this question

There seems to be enough missing from your question I am not sure I am answering it the way you need it to be. For example what parameters and RewriteCond are you using? You can always look at the various Apache .htaccess documentation like this one http://httpd.apache.org/docs/current/mod/mod_rewrite.html but that may add confusion if you are new to this stuff.

To answer your question simply:

RewriteRule ^(.*)$ http://www.newsite.com/$1 [R=301,L]

This should take the parameters that were used to access the old site by the user and pass them on to the new site.

If this is not what you were thinking, let us know.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.