apache如果条件-HTTP标头参数
我对VHOST规则的条件有一个疑问。 我只需要在存在特定的参数中添加并包括重定向文件。
我认为我可以做类似的事情:
<If "%{HTTP:X-block-redirect} in { 'false' }">
IncludeOptional ...
</If>
但是我仍然认为我缺少一些东西。 例如,如果不存在块状重新定位(或者像我的条件一样是错误的),则应添加include-optional文件,但如果是正确的,则不应。
我认为与类似的条件相匹配:
<If "%{HTTP:X-block-redirect} **not** in { 'true' }">
...
</If>
可以更好地工作,但是我正在努力创建一个像“如果不是这样,那就这样做” ... 你能帮助我吗?
多谢!
I have a question about an condition into vhost rules.
I need to add and IncludeOptional redirects files only if a specific param into the header is present.
I think that I can do something like:
<If "%{HTTP:X-block-redirect} in { 'false' }">
IncludeOptional ...
</If>
but I still think that i'm missing something.
For example, If the block-redirect is not present (or it's false like my If condition), it should add the IncludeOptional files but if it's true it shouldn't.
I think that a condition that match something like:
<If "%{HTTP:X-block-redirect} **not** in { 'true' }">
...
</If>
can work better but I'm struggling on how to create an if like "if NOT this DO that"...
Can you help me?
Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了解决此问题,我刚刚使用了一个(and Simple)!='true'条件。
我以为我无法检查一个值,而不是一个值,但我错了。
我希望该解决方案可以帮助其他问题的人!
In order to resolve this I've just used a single (and simple) !='true' condition.
I thought I could not check a single value instead of an array of values, but I was wrong.
I hope this solution can help someone else with similar problems!