繁体   English   中英

.htaccess 301重定向。 从一个域重定向到另一个域

[英].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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM