1
votes

We have 3 domains in play here. Domain1.com is the main site, domain2.com is the smaller second site, and domain3.com is a vanity URL that redirects from domain1 to a Spanish version of domain2.

What we need to have happen is for domain3.com/subpage to redirect to domain2.com/subpage, however the original redirect of the vanity URL is overriding any attempts we make.

Is this kind of redirect possible?

Here is the original redirect in domain1.com's htaccess file:

RewriteCond  %{HTTP:Host} ^www\.domain3\.com$
RewriteRule  (.*) http\://www\.domain2\.com/spanish-version [I,R]

These are the attempts at making the needed redirect happen (also in domain1.com's htaccess file):

RewriteCond  %{HTTP:Host} ^www\.domain3\.com/subpage$
RewriteRule  (.*) http\://www\.domain2\.com/spanish-version/subpage [I,R]

RewriteRule ^domain3\.com/subpage?$ /spanish-version/subpage [NC,R=302,U]
1

1 Answers

1
votes

Rules for your domain3 should look like this :

RewriteCond  %{HTTP:HOST} ^(www\.)?domain3\.com$ [NC]
RewriteRule ^/?(subpage_name)/?$ http://www.domain2.com/$1 [NC,R,L]

This will redirect

www.domain3.com/subpage

to

www.domain2.com/subpage

(www.)? in HTTP:HOST variable is to make the "www" part optional in url, so in this case

urls with or without "www" would also work.