Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to create Rule for mod_rewrite to forward queries to another site with saving original path in address-string?

share|improve this question
1  
You'll get more and better answers if you ask on serverfault.com or webmasters.stackexchange.com –  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

1 Answer 1

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

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

Your Answer

 
discard

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.