2013-05-20 136 views
1

我想重定向與郵件開始一個https://anotherSub.domain.com重定向所有子域到另一個域的Apache

我如何能做到這一點的我的web服務器網站的所有子域?

Put this at the top of the yours default apache config file 
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^SUBDOMAIN.* 
RewriteRule ^(.*) YOUR LINK (ex. http://www.google.it) 
+0

在你的默認的Apache配置文件 'RewriteEngine敘述上 的RewriteCond%{HTTP_HOST}^* SUBDOMAIN重寫規則 ^(。*)您的鏈接(例如HTTP的頂部將這個。 google.it)' – DEK4

回答

1

此代碼對domain.commail開始,它改寫爲https://anothersub.domain.com任何子域匹配。 。// WWW:

RewriteEngine on 
RewriteCond %{HTTP_HOST} ^mail(.*?).domain.com [NC] 
RewriteRule ^(.*)$ https://anothersub.domain.com/$1 [L, 301] 
相關問題