Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Is it possible to create a rule for mod_rewrite which forwards queries to another site while saving original path in address-string?

share|improve this question
You'll get more and better answers if you ask on or – Doug Harris Jan 21 '11 at 16:20
@DougHarris: Please do not encourage cross-posting. If it is off topic it will be migrated to another site. – Wuffers Jul 7 '11 at 6:16

I'm not mod_rewrite expert, but have you tried something like:

RewriteCond %{HTTP_HOST} ^olddomain\.com [NC]
RewriteRule ^(.*)$1 [R=301,L]
share|improve this answer
That task solved simple over iptables. nat+masquerade - good solition – user64081 Mar 16 '11 at 9:45

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.