I have a subdomain called sub.domain2.com which I want to point to domain1.com/folder/
I have set up an A record to point sub.domain2.com to domain1.com and a rewrite rule to the point the开发者_如何学C subdomain to the subdirectory:
RewriteCond %{HTTP_HOST} sub\.domain2\.com$
RewriteRule (.*) http://sub.domain2.com/folder/$1 [L]
However I don't want the subdirectory /folder/ showing in the URL which it currently is?
Thanks Alex
remove http://.../
because it will force external redirect.
RewriteCond %{HTTP_HOST} sub\.domain2\.com$
RewriteRule (.*) /folder/$1 [L]
Why don't you set DOCUMENT_ROOT of sub.domain2.com
to domain1.com/folder
in your apache config.
精彩评论