【发布时间】:2014-05-03 21:54:36
【问题描述】:
只有当请求是“https”时,我才想将用户重定向到身份验证页面。
目前我已经在我的 .htaccess 文件中编写了以下内容来做同样的事情,但它不起作用。
SetEnvIf Request_Protocol ^HTTPS.* IS_HTTPS
AuthType shibboleth
AuthName "Login"
ShibRequireSession on
require user abcd
Allow from env=IS_HTTPS
确定 HTTPS 的正则表达式是否正确?早些时候我有如下的 SetEnvIf 语句。这也没有奏效。
SetEnvIf %{SERVER_PORT} ^80$ IS_NON_SSL
AuthType shibboleth
AuthName "Login"
ShibRequireSession on
require user abcd
Allow from env=!IS_NON_SSL
但根据 SetEnvIf 指令 (http://httpd.apache.org/docs/2.2/mod/mod_setenvif.html) 的文档,SERVER_PORT 变量不可用。
【问题讨论】:
标签: regex apache .htaccess mod-rewrite httpd.conf