这条规则令我头疼:RewriteCond%{HTTP

编程入门 行业动态 更新时间:2024-10-12 12:30:29
这条规则令我头疼:RewriteCond%{HTTP_USER_AGENT} ^ $ [NC,OR](This rule give me headaches: RewriteCond %{HTTP_USER_AGENT} ^$ [NC,OR])

我使用支付方法(mercadopago)在wordpress中的woocommerce,需要从我的服务器外发送通知。

我还使用了“ithemes安全插件”,该插件使用了http://pastebin.com/5Hw9KZnW中的重要黑名单。 此列表如下所示:

# Begin HackRepair.com Blacklist RewriteEngine on RewriteCond %{HTTP_USER_AGENT} ^$ [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^[Ww]eb[Bb]andit [NC,OR] etc. RewriteRule ^.* - [F,L] # End HackRepair.com Blacklist

但ithemes安全阻止通知,因为发件人没有指定用户代理。 管理员和客户也不会收到付款通知电子邮件。

我发现的唯一时间解决方案是在.htaccess文件中注释这一行。

# RewriteCond %{HTTP_USER_AGENT} ^$ [NC,OR]

然后通知工作正常。 问题是,在我保存插件中的选项后,它会重新生成黑名单并且#消失了。

有没有办法在htaccess中的ithemes安全代码之外添加规则,所以它会覆盖原始规则? 或者也许为此创建某种白名单规则,所以在保存ithemes选项后它没有删除?

谢谢!!

im using a payment method (mercadopago) for woocommerce in wordpress which needs to send notifications from outside my server.

Also im using the "ithemes security plugin" which uses an important blacklist from http://pastebin.com/5Hw9KZnW. This list starts like this:

# Begin HackRepair.com Blacklist RewriteEngine on RewriteCond %{HTTP_USER_AGENT} ^$ [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^[Ww]eb[Bb]andit [NC,OR] etc. RewriteRule ^.* - [F,L] # End HackRepair.com Blacklist

But ithemes security blocks the notifications because the sender dont have a user agent specified. And nor the admin nor the client receive the payment notification emails.

The only temporal solution i´ve found was commenting this line in the .htaccess file.

# RewriteCond %{HTTP_USER_AGENT} ^$ [NC,OR]

Then the notifications work ok. The problem is that after i save options in the plugin, it regenerates the blacklist and the # is gone.

Is there a way to add a rule outside the ithemes Security code in the htaccess, so it will override the original rule? Or maybe create some kind of whitelist rule for that, so after saving the ithemes options its not removed?

Thank you!!

最满意答案

你可以像这样将它列入白名单(必须 # Begin HackRepair.com Blacklist行之前添加:

RewriteCond %{HTTP_USER_AGENT} ^$ RewriteRule ^ - [L]

You can whitelist it like this (must add this before the # Begin HackRepair.com Blacklist line:

RewriteCond %{HTTP_USER_AGENT} ^$ RewriteRule ^ - [L]

更多推荐

本文发布于:2023-08-08 00:30:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1466644.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:这条   令我   规则   HTTP   RewriteCond

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!