404??,很多人都知道,如果要??的url不存在的?候就?取?示???面.以往在?理404方面我?通常的做法是要?????行字,而有心人士或????其稍加美化,另外一少部份想投?取巧的?伙甚至用meta??做延??向,?此而已,其?404?可以?我?做很多事,?就是今天我?要??的重?了.
首先我??明一下我的404究竟都能?我做哪些事情:
1.他可以告?我何??自哪?的用?要??我哪?URL?果失?了.
2.他能告?我?方?何要????URL,并?助我?化?站
3.他能告?我?方的IP地址
4.他能告?我此人的居心何在
5.我可以?他把那些不想告?我的??嘴
6.他能把他想要告?我的用email方式??我
7.他能?我做301永久重定向.
8.他能告?我有人正在??入侵我的?站或主?
?起?很玄也很炫,好吧,接下?我?就???一下究竟他是怎?做到的.逐一分析:
1.我?可以用PHP捕捉用?的?源URL和?前的URL,所以第一?我?可以很??的做到.
2.因?有了?源URL,所以你就能很直?的猜?到用?的意?了,我??例子,就像我的?站http://www.7di.net,如果某?用?的?源URL是http://www.7di.net,而捕捉到他目前的URL是http://www.7di.net/user.php?id=1?就?明此人在??我的?站的?候???了某?人的?人?料???果找不到??人的?料?而出?,?明:ID=1的??可能不存在?已?被?掉了,那?你就要看一下?站上是否?有??URL的超?接,如果有的?就要想?法把它??掉吧!
3.??功能就比???了,只需要用PHP捕捉一下?方的ip即可.然後配合其他?站的IP?物理地址的功能就能知道此人?自哪?了.
4.??功能很好,很?大.因?我的?站www.7di.net是自己配置的服?器,所以安全方面都要靠自己??理,而往往有些不入流的?伙??人的服?器感?趣,他??用程序??各?方法??入服?器,而此?你就???你在短???收到大量的404??,且?源URL?空,他?要??的URL都是一些很敏感的URL,此?你需要做的就是打?你的防火??置,然後乾?俐落的封掉??IP.最近?段??我就是用此方法封了?十?IP,真是小兵立大功!忘??了,信息??部的IP也被我封了,我服?器在台?你????什麽?,真是的~~!
5.???,??插件??始的?候?我非常??,因?托他的福我每天?收到?百封Email,有的是因?用?正常???致的,有的是因?各家搜索引擎??集?容?致的,有些是因?小?三?想入侵?致的,?之不?其?,後?我稍作改?,把?展名符合?件或IP符合?件的都加入了??,只要?些符合?件就不用?送Email了,??一?清爽多了.
6.?一切都??不了PHP即??送Email的功能,我的做法是修改PHP.INI???PHP?部mail函??送,?然了如果你也可以用其他的方法,例如:安?sendmail或者??一?mail??藉助第三方smtp?送皆可.只要你爽就好(具???不是今天的????).
7.既然能???到???面,?明用???的URL是不存在的,所以我?要引?用?能???到正?的URL才?,那?既然是引?用???正?的URL或?你??直接用一?meta??或一句JS延?就行了何必大?周章301?向呢?因?我不想被搜索引擎??我是在作弊!回答完?.
8.?一?我在上?已??述?了,基本上?於小?三的判?要根?你的??和?你自己?站的熟悉程度??定,更有甚者,你要大??解你的?站都有哪些URL被其他?站?反?了(??啊,非一朝一夕能一蹴而就的).
??的,?放的否完了,接下?好?要上演了,把下?的代?存?404.php,然後apache或nginx之?的把你的404???指向??就行了.
<?PHP#设置URL,注意没有后划线/$MyURL = (isSet($_SERVER['HTTP_HOST'])) ? Str_iReplace('http://','',StrToLower(rTrim($_SERVER['HTTP_HOST'],'/'))) : 'www.7di.net';#设置URL,注意没有后划线/$MyDomain = (isSet($_SERVER['HTTP_HOST'])) ? 'http://'.Str_iReplace('http://','',StrToLower(rTrim($_SERVER['HTTP_HOST'],'/'))) : 'http://www.7di.net';//?定??.主要用?修正8小??差Date_Default_Timezone_Set('Etc/GMT-8');//输出头部Header('Content-type:text/html; charset=utf-8');/** 发送?? 参数: 收件人,?件??(不可有?行符),?件?容(行?行之?必?用\n分隔,每行不可超?70?字符) ?明: ?用PHP?置函式Mail?送?? 返回: 返回布?值 用法: $IsSend=Fun::Mail2($email,$tit,$msg);/**/Function Mail2($to,$tit,$msg) { IF(Filter_var($to,FILTER_VALIDATE_EMAIL)==''){ throw new Exception('??地址??!'); } $tit='=?UTF-8?B?'.Base64_Encode($tit).'?='; $msg = str_replace("\n.","\n..",$msg); //Windows如果在一行开头发现一个句号则会被删掉,要避免此问题将单个句号替换成两个句号 Return Mail($to,$tit,$msg,'From:see7di@gmail.com'."\n".'Content-Type:text/html;charset=utf-8');}$msg='<table cellspacing="0" cellpadding="0" border="0"><tr><td style="padding:5px;background-color:#F57900;font-size:13px;border:2px solid #222;color:#222;">';$msg.=(isSet($_SERVER['REMOTE_ADDR'])) ? "<b>??者IP是:</b><br><a href='http://www.ip138.com/ips138.asp?ip={$_SERVER['REMOTE_ADDR']}&action=2' target='_blank'>{$_SERVER['REMOTE_ADDR']}</a><br>" : '';$msg.="<b>????:</b><br>".date('Y-m-d H:i:s',time()).'<br><br>';$msg.=(isSet($_SERVER['REMOTE_HOST'])) ? "<a href='http://www.ip138.com/ips138.asp?ip={$_SERVER['REMOTE_HOST']}&action=2' target='_blank'>{$_SERVER['REMOTE_HOST']}</a><br><br>" : '<br>';$msg.=(isSet($_SERVER['HTTP_USER_AGENT'])) ? "<b>??者???料:</b><br>{$_SERVER['HTTP_USER_AGENT']}<br><br>" : '';$msg.=(isSet($_SERVER['REQUEST_URI'])) ? "<b>要??的?面是:</b><br>{$MyDomain}{$_SERVER['REQUEST_URI']}<br><br>" : '';$msg.=(isSet($_SERVER['HTTP_REFERER']) And Trim($_SERVER['HTTP_REFERER'])!='') ? "<b>?源地址是:</b><br>{$_SERVER['HTTP_REFERER']}<br><br>" : '';$msg.='</td></tr></table>';//哪些?型的URL不?Email,如果不屏蔽掉?些的?能?死我$arr=Array('mp3','rm','swf','jpg','gif');//哪些IP不?Email,?些基本都是搜索引擎的蜘蛛$arrIP=Array('66.249.77.217','66.249.74.67');//要??的?展名$needEx=Explode('.',StrToLower(Trim($_SERVER['REQUEST_URI'])));$needEx=end($needEx);IF(!In_Array($needEx,$arr) And !In_Array(Trim($_SERVER['REMOTE_ADDR']),$arrIP)) { Mail2('see7di@gmail.com','?自【'.$MyURL.'】的404??!',$msg);}unSet($MyURL,$msg,$needEx,$arr);Header('HTTP/1.1 301 Moved Permanently');Header ("Location:{$MyDomain}");Die();
注意:如果你感?上?代?中所??的功能?不能?足你的?望,那?鼓?你改?他,完善它,加?他,我?不反?,但?你把你的作品分享?我,??啦~~~~!
?迎大家一起?我的PHP群交流切磋,??是:223494678

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

The Storage::download method of the Laravel framework provides a concise API for safely handling file downloads while managing abstractions of file storage. Here is an example of using Storage::download() in the example controller:

PHP logging is essential for monitoring and debugging web applications, as well as capturing critical events, errors, and runtime behavior. It provides valuable insights into system performance, helps identify issues, and supports faster troubleshoot

Laravel's service container and service providers are fundamental to its architecture. This article explores service containers, details service provider creation, registration, and demonstrates practical usage with examples. We'll begin with an ove


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

WebStorm Mac version
Useful JavaScript development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Linux new version
SublimeText3 Linux latest version

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
