Reputation: 4494
Trying to figure out how to redirect a domain alias [www.alias.com] to a subfolder [/subfolder/] of the primary domain [www.primary.com] so that the users still see the primary domain name:
i.e.
requests for: www.alias.com/whatever/
get redirected to: www.primary.com/subfolder/whatever/
-thanks
Upvotes: 2
Views: 2973
Reputation: 786041
Put this code in your DOCUMENT_ROOT/.htaccess
file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?alias\.com$ [NC]
RewriteRule ^ http://www.primary.com/subfolder/%{REQUEST_URI} [NE,R=301,L]
Upvotes: 1