0

ユーザーが以前にリダイレクトされた場合、Apache がルールを適用するのを止めたい:

例:

Redirect 301 /foo/bar.php https://example.org/foo/bar

## Don't apply this if the user has been redirected using the 301 above
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)/$ index.php?foo=$1 <-- I don't want to add the parameters here, if the user has been redirected

これまで SetEnvIf を使用してステータスを確認することを考えていましたが、これはここでも一致しません。

SetEnvIf Referer "^$" local_referal=1

RewriteCond %{ENV:local_referral} 1
RewriteRule ^(.*)$ https://example.com/$1 [L,R=301]
4

0 に答える 0