[英]Redirecting folder from one domain to another using .htaccess 301 redirect
[英].htaccess 301 redirect. Redirect from one domain to another
我想问一下,如何从该URL重定向(例如): http : //firstapp.com/VD/Controller/Action (VD-是虚拟目录,Action-有很多操作,因此应该将所有操作都重定向到新网址)
对此: http : //secondapp.com/Action ?
使用.htaccess
我尝试了这个,但是没有用
RewriteCond %{HTTP_HOST} ^(.*)$ [NC]
RewriteRule ^/VD/Controller/(.*)$ http://secondapp.com/$1 [L,R=301,NC]
将此规则放在firstapp.com
根.htaccess中:
RewriteEngine On
RewriteCond %{HTTP_HOST} firstapp\.com$ [NC]
RewriteRule ^VD/Controller/(.*)$ http://secondapp.com/$1 [L,R=301,NC]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.