Reputation: 509
heres the situation i have the domain 1
http://domain-1.com/somefolder-1
sometimes the domain 1 have someinformation after the subfolder
http://domain-1.com/somefolder-1/PRESERVE-THIS-PATH
What i need is to send the domain-1/somefolder-1
to another domain
http://domain-2.com/anotherfolder-1/PRESERVE-THIS-PATH
preserving the path if present
Upvotes: 0
Views: 30
Reputation: 785256
You can use this rule in site root .htaccess of domain-1
:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(?:www\.)?domain-1\.com$ [NC]
RewriteRule ^somefolder-1(/.*)?$ http://domain-2.com/anotherfolder-1$1 [L,NC,R=301,NE]
Upvotes: 2