[英]Redirect folder to subdomain and another server
I have following situation: 我有以下情况:
www.domain.com/folder
and I want to redirect this folder to 我想将此文件夹重定向到
www.subdomain.domain.com
And this subdomain is redirected via DNS to another IP/Server. 并且此子域通过DNS重定向到另一个IP /服务器。
Is this possible, and how if so? 这有可能吗?
Put this code in your DOCUMENT_ROOT/.htaccess
file: 将此代码放在您的
DOCUMENT_ROOT/.htaccess
文件中:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(folder(?:/.*|$))$ http://www.subdomain.domain.com/? [L,R]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.