0
我需要指向(不重定向)子域到根域中的目錄。比如我有以下領域:PHP .htaccess點子域到根目錄中,不需要重定向
https://test.example.com
我想,要指向的目錄:
https://example.com/apple
這需要在不脫離子域更改URL的情況發生。這也需要包括任何URL參數,例如:
https://test.example.com/hello-world
應該指向(不定向)到:
https://example.com/apple/hello-world
在我.htaccess
文件(在子域的根目錄下),我有:
RewriteEngine on
RewriteBase/
RewriteCond %{HTTP_HOST} ^test\.example\.com$
RewriteCond %{REQUEST_URI} !^/apple$
RewriteRule ^(.*)$ https://example.com/apple/$1
這個工作,但它重定向。有關如何在不使用重定向的情況下將子域指向該目錄的任何建議,請使用mod_proxy
?
的[htaccess的重寫子域到目錄]可能的複製(http://stackoverflow.com/questions/10642426/htaccess-rewrite-subdomain-to-directory) –
@ ponury-kostek所有這些都重定向 –