2011-04-12 83 views
3

我想重定向一個子域的請求到主域。 即:xxx.domain.com/blah/xyz - >domain.com/blah/xyzApache RewriteCond(子域)

我rewriteconds工作的優良xxx.domain.com但對於像xxx.domain.com/123/xyz400錯誤的請求任何是我得到的...

任何幫助將不勝感激。

+3

你現在使用的是什麼規則? – 2011-04-12 21:14:39

回答

7

規則應該是這樣的:

RewriteCond %{HTTP_HOST} ^xxx.domain.com 
RewriteRule (.*) http://domain.com/$1 [L]