目标
如果请求是http://⋯/.htaccess,
则不显示该文件的内容,而是
显示 ErrorDocument 403,
将 <strong>only <code>http:// 重写为 <code>https://。
问题
URL 被重写为https://⋯/403.shtml,
而不是所需的 <code>https://⋯/.htaccess。
细节
ErrorDocument 403 和
.htaccess 的保护由网络托管服务提供商设置。
HTTPS 重写在 .htaccess 文件中设置:
RewriteEngine on
RewriteCond %{HTTPS} !on
RewriteRule .* https://%{HTTP_HOST}/$0 [L,QSA,R=301]