.htaccess code to show your customized error info
run method:
[1]. Make a directory structure like this : C:/wamp/www/jay/seo/404
[2]. Make a file inside  C:/wamp/www/jay/seo/404/index.php
[3]. Make a file inside  C:/wamp/www/jay/seo/404/404.php
[4]. Make a file inside  C:/wamp/www/jay/seo/404/.htaccess
and copy paste below code in appropriate file name
Now run in url
[A]. http://localhost/jay/seo/404/
[B]. http://localhost/jay/seo/404/america.php



<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>404 Error Testing</title>

<div>Hi This is test page.<br> now try to run this page <br>america.php </div>




<TITLE>Error Oops! An Error Page not found</TITLE>
<meta http-equiv=”REFRESH” content=”400; url=http://www.google.com”>
<META NAME=”description” CONTENT=”Error of your site”>
<META NAME=”keywords” CONTENT=”many keywords”>
<p align=”center”>
<h1>This is customized Error Page Error 404 Not found this page</h1>
$ip = getenv (“REMOTE_ADDR”);
//$ip = $_SERVER['REMOTE_ADDR'];
$requri = getenv (“REQUEST_URI”);
$servname = getenv (“SERVER_NAME”);
$combine = $ip . ” tried to load ->” . $servname .”From ->”. $requri ;
$httpref = getenv (“HTTP_REFERER”);
$httpagent = getenv (“HTTP_USER_AGENT”);
$today = date(“D M j Y g:i:s a T”);
$message = “$today
n $combine
n User Agent = $httpagent
n ref Agent = $httpref “;

$to = “jay@sourcebits.com”;
$subject = “yourdomain Error Page”;
$from = “From: admin@moonreturn.comrn”;

if(@mail($to, $subject, $message, $from))
echo “<br>success to sending mail to web site administrator about this error”;
echo “<br>Message=”.nl2br($message);
echo “Message try to send to web administrator through mail but till not success”;




<Files .htaccess>
order allow,deny
deny from all
ErrorDocument 400 test/401.php
ErrorDocument 401 test/402.php
ErrorDocument 403 test/403.php
ErrorDocument 404 test/404.php
AddHandler application/x-httpd-php .php .html .htm .shtml
ErrorDocument 404 http://localhost/jay/seo/404/404.php


Share on Facebook