好吧,我有一個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服務器僅用於身份認證的請求後,一些黑盒容器在某種程度上起到了一切。