如果之前发生过重定向,则不要应用规则

问题描述

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

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)