문제

Ok 가 apache IBM HTTP Server WAS 6.1 설치

certs 올바르게 설치하고 성공적으로드 httphttps 페이지입니다.

후에 성공적인 j_security_check 인증 https, 고 싶은 지금 공인 페이지에(이후의 모든 페이지)이하로드 http.

이 모든 작업 mod_rewrite 기 때문에 나는 변경을 원하지 않는 응용 프로그램 코드를 위해 뭔가 정말 간단해야하는지에 webserver.

내가 생각하는 것이 작동하지만 그렇지 않고 두려워기 때문에 그것이 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] 을 강제로 실행되는 규칙은 마지막 규칙에서 실행하는 요청을 리디렉션합니다.

내가 발견이 작은 보석 후에 조금 googleing.

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 도움이되지 않았습니다.

지금 내가 알기에는 나의 응용 프로그램 서버 통신에 90809443 각각 그러나 나는 찾을 수 없습니다 single virtualhost 웹 서버 httpd.conf.

나는 몇 가지 테스트와 다른 재작성 규칙 동안 인증되지 않는다고 보았다 나 mod rewrite code 했..

그래서:어떻게 사용하는 websphere 모 다시 작성 인증 후?

그것은 같은 웹 서버에만 사용에 대한 인증되지 않은 요청 후에는 일부를 블랙 박스 컨테이너를 제공하 모니다.

도움이 되었습니까?

해결책

이 솔루션을 위한 http https http

가 발생할 수 있습니다.한 상태이고 재작성 규칙에서 가상호스트처럼 arcticle 말했지만 어떤 이유로 상속하고 싶지 않았다.

RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /path/login\.jsp\ HTTP/1\.1
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

   <VirtualHost 000.000.000.000:443>
    ServerName servername
    ServerAlias url.com machinename
    DocumentRoot d:/ibmhttpserver61/htdocs/en_US
    ErrorLog d:/ibmhttpserver61/logs/secerr.log
    TransferLog d:/ibmhttpserver61/logs/sectrans.log
    SSLEnable
    Keyfile d:/ibmhttpserver61/ssl/ctxroot.kdb
    SSLV2Timeout 100
    SSLV3Timeout 1000 

    RewriteEngine On
    RewriteCond %{REQUEST_URI} /path/secure/index.jsf
    RewriteRule ^(.*)$ http://url/path/secure/index.jsf [R,L]    

    </VirtualHost>

다른 팁

야생 guess:해 두 번째 논리적이 있거나와(i.e아[OR]과 RewriteCond 기본값과)?

RewriteCond %{THE_REQUEST} !login\.jsp.*action=init
RewriteCond %{THE_REQUEST} !login\.jsp.*action=submit
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top