如果用户之前已被重定向,我想阻止 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]