Issue
Everytime someone visits www.cars.com/parts I want them to be redirected to www.planes.com. After that the paths are the same. For example www.cars.com/parts/engine should go to www.planes.com/engine and www.cars.com/parts/wheels should go to www.planes.com/wheels and so forth. As of right now I have the following in my httpd.conf file:
RewriteEngine on
ServerName www.cars.com
DocumentRoot /var/www/htdocs
RewriteCond %{HTTP_HOST} www.cars.com/parts$ [NC]
RewriteRule ^/(.*)$ www.planes.com$1 [R=301,L]
However, the problem is that www.cars.com/parts is taking me to www.planes.com/parts and not www.planes.com. Help would be much appreciated.
Solution
Try changing the RewriteRule to :
RewriteRule ^/parts(.*)$ www.planes.com$1 [R=301,L]
The $1 is substituted with the pattern detected in the parenthesis. So now it should append everything after /parts.
Answered By - Dimitris Kalaitzis Answer Checked By - Marie Seifert (WPSolving Admin)