我对htaccess一点也不熟悉 . 我需要Htaccess代码,它会将http重定向到https . 我使用下面的代码:
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
但主要的问题是,当我试图测试服务器速度时,我得到了以下建议:
To speed up page load times for visitors of your site, remove as many landing page
redirections as possible, and make any required redirections cacheable if possible.
http://xxxx.com/ is a non-cacheable redirect to https://xxxx.com/
那么,如何使其可缓存?
1 回答
错误说明了一切 . 要使其在浏览器中永久缓存,请使用
R=301
: