I'm trying to redirect some URLs on my Drupal domain to a subdomain on a different domain. I want to redirect URLs in this format:

http://www.domainone.com/foo/abc123

to:

http://bar.domaintwo.com/abc123

So basically the "foo" part of the URL is removed, Domainone becomes the "bar" subdomain on Domaintwo, and the end of the URL is kept.

I think I'm pretty close but can't quite get it to work. I've added this:

RewriteRule ^/foo/(.*) http://bar.domaintwo.com/$1 [R=301,L,QSA]

just below:

# RewriteBase /

in my .htaccess file, but I get a 404 on Domainone.

Thanks very much.

Comments

mrtbc’s picture

Gentle bump.