我在我的.htaccess文件中使用以下內容,強制在任何用戶訪問我的網站時使用https而不使用https。刪除「www。」 from url with strongful https
但是,如果用戶訪問https://www.mysite.co,我希望能夠從請求中刪除www。
請問你能告訴我什麼我需要在我的.htaccess文件中修改,以便從url中刪除www,同時保持有力的https?
謝謝,
最大。
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://mysite.co/$1 [R,L]
重複:http://stackoverflow.com/questions/6399406/remove-www-from-https –
看到這個職位......這是一個很好的解釋 http://stackoverflow.com/questions/10725357/redirect-https-to-non-www-and-http-to-www/10726167#10726167 – Zak
...如果它已經有東西的副本,請將它作爲副本關閉* - 服務器故障已經存在有一百萬mo.d_rewrite的問題,你的重複目標會比[我們]更好(http://serverfault.com/questions/214512/everything-you-ever-wanted-to-know-about-mod-rewrite-規則,但是很害怕到) – voretaq7