質問

各ルールの設定以下の動作時に使用。しかし、使用すると、ルールの行動変化します。

時のルールセット#2は単体での使用請求 https://internal/Security/login 書き換えによりApacheをsapphire/main.php なブラウザの知識です。このとさせていただく予定。

が両方のルールセットを使用すると、要求であり、上記のURLの結果はApacheを送301へのリダイレクト http://internal/sapphire/main.php?url=Security/login.

なぜApacheは送るこのリダイレクトがそうでない内部に書き換え?

# Rule Set # 1
# - Forces all HTTPS requests to HTTP, except for security section requests.
#   Example: request for https://internal/abc/ 
#   -> redirected to http://internal/abc/
RewriteCond %{SERVER_PORT} =443
RewriteCond %{REQUEST_URI} !^/Security($|/.*$)
RewriteRule (.*) http://internal/$1 [R=301,L]

# Rule Set # 2
# - Hands request to CMS - web user does not see this behind-the-scenes rewrite
RewriteRule (.*) sapphire/main.php?url=$1&%{QUERY_STRING} [L]
役に立ちましたか?

解決

L フラグの原因となる還元の書き換えます。として分析されたURLではなく:

RewriteCond %{SERVER_PORT} =443
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /Security[/?\ ]
RewriteRule (.*) http://internal/$1 [R=301,L]
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top