简体   繁体   English

.htaccess减少垃圾邮件

[英].htaccess Reduce Spam

For reduce spam in wordpress comment i using below code: 为了减少WordPress评论中的垃圾邮件我使用以下代码:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} .wp-comments-post\.php*
RewriteCond %{HTTP_REFERER} !.*domainname.com* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]
</IfModule>

My question is: I want to reduce spam in " signup ". 我的问题是:我想减少“ 注册 ”中的垃圾邮件。 The url like this http://www.domain.com/signup 像这样的网址http://www.domain.com/signup

How to change this line: 如何更改此行:

RewriteCond %{REQUEST_URI} .wp-comments-post\.php*

Become Signup ??? 成为注册 ???

Please help me, thank you. 请帮助我,谢谢。

The code in .htaccess stops spam by saying: .htaccess中的代码通过说出以下内容来阻止垃圾邮件:

When accessing the file wp-comments-post.php(which is the file that handles the posting of comments) and the visitor doesn't come from the yourdomain or the user agent of the browser is empty, we can block it. 当访问文件wp-comments-post.php(用于处理评论的文件)并且访问者不是来自yourdomain或浏览器的用户代理为空时,我们可以将其阻止。

The reason is that when somebody posts a comment, they have clicked on a button on your site and so the referrer is yourdomain.com 原因是,当有人发表评论时,他们已经单击了您网站上的按钮,因此引荐来源网址为yourdomain.com

I'm assuming you don't really want this for the page signup as well. 我假设您也不需要页面注册。 People could directly access that page and you want them to sign up. 人们可以直接访问该页面,而您希望他们注册。

To reduce spam in signup, it's better to know how the signup works. 为了减少注册时的垃圾邮件,最好知道注册的工作方式。 WordPress doesn't have a page signup, so I'm assuming you are using a 3rd party plugin for signup. WordPress没有页面注册,因此我假设您正在使用第三方插件进行注册。

Simple way to reduce automated spam signups is to use "honeypot" approach - hide one of required fields you have with styles (for example email) so visitors won't see it. 减少自动垃圾邮件注册的一种简单方法是使用“蜜罐”方法-用样式(例如电子邮件)隐藏您具有的必填字段之一,以使访问者看不到它。 Add additional field with some random name. 添加带有一些随机名称的其他字段。 Adjust SocialEngine signup to use new field instead of email. 调整SocialEngine注册以使用新字段而不是电子邮件。 In case hidden email field is filled with some data stop the registration - you got a bot. 如果隐藏的电子邮件字段中填充了一些数据,请停止注册-您有一个机器人。

(Our team has a simple SocialEngine4 plugin for that called Honeypot) (我们的团队有一个名为Honeypot的简单SocialEngine4插件)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM