0
我试图强制HTTPS对我的投资组合中的每个请求,也从网址中删除WWW。我已经成功然而移除请求WWW当我尝试强制使用HTTPS,我给出的“重定向过多”试图删除www和强制HTTPS
错误这是我的htaccess文件:
# remove www. from HTTPS requests
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.(patrickwhitehouse\.pw)$ [NC]
RewriteRule .* https://%1/$0 [R,L]
# redirect HTTP requests to HTTPS
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(?:www\.)?(patrickwhitehouse\.pw)$ [NC]
RewriteRule .* https://%1/$0 [R,L]
如果我手动输入https://myurl.com,但它可以工作,但是当我访问另一个页面时,HTTPS会返回到HTTP。