2013-02-08 39 views
0

林有這個htaccess的代碼使用htaccess從https重寫爲http如何刪除端口號?

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteCond %{HTTPS} on [AND] 
RewriteCond %{REQUEST_URI} /products-page/bathroom-amenities/nourish-a-spa-line/ 
RewriteRule (.*) http://%{HTTP_HOST}/bathroom-amenities/286-nourish.html 
</IfModule> 

這樣做是給用戶重定向來自:

到:

此代碼正在從https URL重定向到http URL,但爲了這個工作,我需要從結果URL中刪除端口。

任何人都可以幫助我嗎?

+0

你就不能硬編碼的域名? – 2013-02-08 16:33:55

回答

0

用戶SERVER_NAME代替HTTP_HOST

要小心使用UseCanonicalName設置的,很有可能是你想擁有它設置爲關

相關問題