好吧,我有一个apache IBM HTTP Server WAS 6.1
设置HTTP到HTTPS访问http使用mod_rewrite和IBM HTTP Server
我有我的certs
正确安装并可以成功加载http
和https
页面。
通过https
成功通过j_security_check
验证后,我希望现在授权的页面(和所有后续页面)加载为http
。
我希望这一切都与mod_rewrite
一起工作,因为我不想更改应用程序代码,以便在Web服务器上执行简单的操作。
我会认为这会工作,但它不会,我担心这是因为j_security_check
以某种方式绕过mod_rewrite
。
RewriteCond %{HTTPS} =off
RewriteCond %{THE_REQUEST} login\.jsp.*action=init [OR]
RewriteCond %{THE_REQUEST} login\.jsp.*action=submit
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L] <<-- this rule is working
RewriteCond %{HTTPS} =on
RewriteCond %{THE_REQUEST} !login\.jsp.*action=init [OR]
RewriteCond %{THE_REQUEST} !login\.jsp.*action=submit
RewriteRule .* http://%{SERVER_NAME}%{REQUEST_URI} [R,L] <--- this rule is not working or the condition is not returning true
我知道[R,L]
将强制执行的规则是最后一个规则上的要求运行,并相应地重定向。
我发现这个小珠宝后略有谷歌。
mod_rewrite: My rules are ignored. Nothing is written to the rewrite log.
The most common cause of this is placing mod_rewrite directives at global scope (outside of any VirtualHost containers) but expecting the directives to apply to requests which were matched by a VirtualHost container.
In this example, the mod_rewrite configuration will be ignored for requests which are received on port 443:
RewriteEngine On
RewriteRule ^index.htm$ index.html
<VirtualHost *:443>
existing vhost directives
</VirtualHost>
Unlike most configurable features, the mod_rewrite configuration is not inherited by default within a <VirtualHost > container. To have global mod_rewrite directives apply to a VirtualHost, add these two extra directives to the VirtualHost container:
<VirtualHost *:443>
existing vhost directives
RewriteEngine On
RewriteOptions Inherit
</VirtualHost>
添加继承声明,我的单virtualhost
声明指向本机的ip和port 443
没有帮助一位。
现在我知道,我的应用程序服务器上9080
和9443
分别进行通信,但我无法找到Web服务器httpd.conf
一个virtualhost
。
我做了一些测试不同的重写规则而没有通过认证,看到我的mod rewrite
代码工作..
所以:我怎么让WebSphere使用国防部重写身份验证后?
这就像web服务器仅用于身份认证的请求后,一些黑盒容器在某种程度上起到了一切。