开发者

URL Aliasing using .htaccess

开发者 https://www.devze.com 2022-12-10 04:58 出处:网络
I have a dir开发者_StackOverflow中文版ectory \'Domainname1/folder/\'. In Domainname1, I have a sub-directory which is a sub-domain (abc.mydomain.com) of another domain. This is a reference to \'domain

I have a dir开发者_StackOverflow中文版ectory 'Domainname1/folder/'. In Domainname1, I have a sub-directory which is a sub-domain (abc.mydomain.com) of another domain. This is a reference to 'domainname1/folder/'. The thing is I want the URL links accessing 'domainname1/folder/' to display the sub-domain definition. So instead of seeing:

'domainname1/folder/'

They see:

'abc.mydomain.com/path'

How can I do this?


you should use a reverse proxy to do such setup, here a basic howto.

Hope this would help you


You can use the proxying abilities of mod_rewrite to achieve this. In the VirtualHost section for abc.mydomain, you can add:

RewriteRule (.*) http://mydomain/folder/$1 [P]
ProxyPassReverse / http://mydomain/folder
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号