mod_rewrite - one domain to another

djcronos

Verified User
Joined
Mar 21, 2006
Messages
75
Hello,

Since a normal site redirection doesn't rewrite the URL in the browser, I figured the only way to do what I want to do is to incorporate a mod_rewrite rule into the conf file for the domain.

So what I did was vi the domain's httpd config file and entered the following inside the <Directory> tag:

Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^[url]www.foo.com[/url] [NC]
RewriteRule ^/(.*) [url]http://www.bar.com/[/url] [R]

I then restarted Apache via the DA control panel, yet my rewrite rule didn't work.

Am I doing the rewrite rule correctly? If not, where should I put it, and what should it say?

Thanks in advance.
 
Back
Top