簡體   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