RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^expit\.online$
RewriteRule ^(.*)$ http://expit.online:2018$1 [NC,L]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]但是不能从http重定向到https。
发布于 2018-02-15 04:13:32
也许您需要在您的条件下使用[OR]?
尝试将您的规则更改为:
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]https://stackoverflow.com/questions/48791393
复制相似问题