2013-10-31 142 views

回答

0

你沒有找到正確的文檔。閱讀:

http://httpd.apache.org/docs/2.4/en/rewrite/remapping.html#movehomedirs

更新:

作爲開始,寫爲directory/.htaccess

RewriteEngine on 
RewriteRule .* http://thedomain.com/ [R,L,NE] 

.*意味着什麼,因爲規則來自於.htaccess文件,這實際上意味着任何東西在這個二教區

總的來說,這意味着:使用括號中的選項(這將正常工作)將該目錄中的任何內容重定向到主頁。

+0

這並不告訴我如何重定向到根...至少我不認爲 - 這太難理解了,這就是我來到這裏的原因。誰能幫我嗎? –

+0

所以你想重定向'http:// subdomain.thedomain.com/directory/*'到主頁'http:// thedomain.com /',不管'*'是什麼?然後,從文檔中的示例中刪除'$ 1'。或者,如果您的意思是別的,請在您的問題中提供更多示例。 –

+0

是的。 'http:// subdomain.thedomain.com/directory /'重定向到'http:// thedomain.com'。 *是無關緊要的,因爲google上只有這一頁來重定向。我使用哪個示例?我很抱歉,這是一個完整的新手,我失去了甚至要開始的地方。你能爲我輸入嗎? –