使特定的URL响应404错误,而不是200垃圾邮件机器人 [英] Make specific url response 404 error instead of 200 for spam bots

查看:199
本文介绍了使特定的URL响应404错误,而不是200垃圾邮件机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使我的网站的具体网址(的index.php?行动=加入),以响应404错误,而不是200,当防垃圾邮件程序尝试访问它?
我不是PHP程序员,所以可能是它能够以某种方式在.htaccess文件derectives做些什么呢?

How to make my site's specific url (index.php?act=add) to response 404 error instead of 200 when spam bots try to access it ?
I am not php programmer so may be it could be done somehow with derectives in .htaccess file ?

++++

感谢您的答案,但没有帮助(
我需要财产以后像.htaccess文件中的规则:

Thank you for your answers but that did not help (
I need somthing like that rule in .htaccess file:

 <Files "index.php">
 Order Deny,Allow
 Deny from all
 </Files>

但不是index.php文件使用的index.php?行动=添加。

But instead of index.php to use "index.php?act=add".

+++ 现在,它的工作。谢谢!

+++ Now its working. Thank you!!!

推荐答案

使用PHP(index.php文件)

using php (file index.php)

if ($_GET['act'] == 'add') {
    if (condition to check spambot/useragent/ipaddress/cookie) {

        header("HTTP/1.0 404 Not Found");
        exit;

    } else {

        //
        //
        // your code for 'REAL' users

    }
}

这篇关于使特定的URL响应404错误,而不是200垃圾邮件机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆