我在我的一台机器上设置了phpMyID,并且我试图让apache仅在提交密码时重定向到HTTPS。我之所以这样做,是因为我最初重定向所有openid流量的设置不起作用,stackoverflow不喜欢我的自签名证书。这是我写的新规则,但它不起作用:
RewriteRule http://%{SERVER_NAME}/openid/index.php(\?.+)$ https://%{SERVER_NAME}/openid/index.php$1发布于 2008-09-26 03:54:07
您需要使用Cond来测试端口(http或httpd)和查询字符串:
RewriteCond %{SERVER_PORT} 80
RewriteCond %{QUERY_STRING} (.+)
RewriteRule /openid/index.php https://%{SERVER_NAME}/openid/index.php?%1如果是在.htaccess上,则必须改用
RewriteCond %{SERVER_PORT} 80
RewriteCond %{QUERY_STRING} (.+)
RewriteRule openid/index.php https://%{SERVER_NAME}/openid/index.php?%1https://stackoverflow.com/questions/137679
复制相似问题