[英]Forcing https in htaccess gives: The page isn’t redirecting properly
[英]The page isn't redirecting properly - HTTPS HTACCESS rewrite error
我有以下htaccess重写规则
Rule1导致无限循环错误。 我正在尝试将所有请求重定向到HTTPS,但是它不起作用。
由于rule1,rule2也被阻止。 当我对Rule1进行评论时,一切都很好。
如果更改顺序,也会发生此无限循环错误。
请帮助我如何解决此错误
RewriteEngine On
RewriteBase /
#Rule 1: Rewrite all the requests to HTTPS
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
//Rule 2: redirect to the account closed setup
RewriteRule ^(?:abcd)/A-Report/(.+)$ /closed/$1 [NC,L]
提前致谢。
基于这个问题 。
RewriteEngine on
# Check for POST Submission |
# Because POST parameters aren't retained on a redirect.
# You can omit that line if you want to make sure that all POST submissions are secure
# (any unsecured POST submissions will be ignored)
RewriteCond %{REQUEST_METHOD} !^POST$
# Forcing HTTPS
RewriteCond %{HTTPS} !=on [OR]
RewriteCond %{SERVER_PORT} 80
# Pages to Apply
RewriteCond %{REQUEST_URI} ^something_secure [OR]
RewriteCond %{REQUEST_URI} ^something_else_secure
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.