<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WebSiteSecrets101.com &#187; custom 404 error</title>
	<atom:link href="http://www.websitesecrets101.com/tag/custom-404-error/feed" rel="self" type="application/rss+xml" />
	<link>http://www.websitesecrets101.com</link>
	<description>Web site secrets and SEO tips</description>
	<lastBuildDate>Sat, 20 Feb 2010 03:02:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to Create a Custom 404 Error Page</title>
		<link>http://www.websitesecrets101.com/how-to-create-a-custom-404-error-page</link>
		<comments>http://www.websitesecrets101.com/how-to-create-a-custom-404-error-page#comments</comments>
		<pubDate>Sat, 05 Jul 2008 08:19:57 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
				<category><![CDATA[Web Traffic]]></category>
		<category><![CDATA[custom 404 error]]></category>
		<category><![CDATA[custom error message]]></category>
		<category><![CDATA[error files]]></category>
		<category><![CDATA[html folder]]></category>
		<category><![CDATA[web visitor]]></category>
		<category><![CDATA[webpage editor]]></category>

		<guid isPermaLink="false">http://www.websitesecrets101.com/?p=40</guid>
		<description><![CDATA[Imagine being able to setup a custom error message page that looked good, told the visitor what had gone wrong and then suggested some alternative links to other locations on your site, such as the home page, site-map or even a search page.]]></description>
		<wfw:commentRss>http://www.websitesecrets101.com/how-to-create-a-custom-404-error-page/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Avoid Loosing Thousands of Dollars From Your website.</title>
		<link>http://www.websitesecrets101.com/avoid-loosing-thousands-of-dollars-from-your-website</link>
		<comments>http://www.websitesecrets101.com/avoid-loosing-thousands-of-dollars-from-your-website#comments</comments>
		<pubDate>Sun, 07 May 2006 15:42:51 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
				<category><![CDATA[Managing Errors]]></category>
		<category><![CDATA[custom 404 error]]></category>
		<category><![CDATA[ftp tool]]></category>
		<category><![CDATA[lost sales]]></category>
		<category><![CDATA[open notepad]]></category>
		<category><![CDATA[safe guard]]></category>

		<guid isPermaLink="false">http://www.websitesecrets101.com/22/avoid-loosing-thousands-of-dollars-from-your-website/</guid>
		<description><![CDATA[<p>By Bruce Hearder</p>
<p>Imagine this scenario.</p>
<p>You&#8217;ve just released a new product onto the web.<br />
You&#8217;ve sent out all the marketing material and you&#8217;ve signed up as many  affiliates as possible and sit back, grab your favorite beverage and wait for  the dollars to roll in.</p>
<p>You wait, and you wait.. Nothing.. Not a single sale..</p>
<p>You then think &#8220;I&#8217;ll give it another hour and two and see if anything happens  then&#8221;.<br />
You know your affiliates have been promoting your product, you&#8217;ve been getting  the emails, but no sales have occurred..</p>
<p>You start to think maybe something is wrong with your site. So you decide to  click on a link in one of your affiliates email and you get the dreaded &#8220;404 &#8211;  File not Found error&#8221;.</p>
<p>Then you suddenly realize that the link you gave all your affiliates was wrong.<br />
You told them to visit yourdomain.com/specialoffer.html but the real location is  yourdomain.com/special-offer.html</p>
<p>So you dash into your site with your FTP tool and quickly rename the page to the  new name, and within minutes sales start coming in..</p>
<p>Phew.. But how many lost sales? How many thousands of dollars have you just  lost??</p>
<p>It freighting, and it can happen so easily..</p>
<p>Wouldn&#8217;t it have be good to have some sort of safe guard in place, that sent you  an email when the error first occurred with the very first visitor.</p>
<p>Well, there is such a tool. Im going to show you how to implement it for FREE  and very easy to setup.</p>
<p>To make this work we need to modify our sites .htaccess file (this file lives in  the root directory of your hosting account).</p>
<p>If you don&#8217;t have a .htaccess simply make one using notepad<br />
(For more information on this see  http://www.websitesecrets101.com/3/creating-a-custom-404-error-page/ )</p>
<p>Then add the following line to bottom of the file.</p>
<p>ErrorDocument 404 /404error.php</p>
<p>Save the file and update your server.</p>
<p>Now we need to make the 404error.php file..</p>
<p>Simply open Notepad on your PC and paste in the following code :</p>
<pre>&lt; ?PHP</pre>
<pre>$email = "you@yourisp.com";</pre>
<pre>$host='http://'.$_SERVER["HTTP_HOST"];
$url = $host.$_SERVER["REQUEST_URI"];
$referrer = trim($_SERVER["HTTP_REFERER"]);</pre>
<pre>if ($url != 'favico.ico' and $url != 'robots.txt')
{
if ($referrer == '')
   $referrer = 'An Unknown source OR someone who directly keyed in the link';
else
   $referrer=''.$referrer.'';
$subject = '404 Error on '.$host;
$message = 'Hi</pre>
<pre>A visitor from '.$referrer.' tried unsuccessfully to  access '.$url.' You may want to try and fix this error';</pre>
<pre>$headers = 'MIME-Version: 1.0'."\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1'."\r\n";
$headers .= 'From: 404 Watcher'."\r\n";</pre>
<pre>ail($email,$subject,$message,$headers);
}
header("HTTP/1.1 404 Not Found");
header('Location: '.$host);
?&gt;</pre>
<p>Make sure that you change the line that starts with $email to have your email  address. No one on the web will see that email address.<br />
It is the address that you want all the errors sent to.</p>
<p>Save the file and copy 404error.php file up to your web site&#8217;s root document.</p>
<p>Now try it out. Try typing in a filename that does not exist like yourdomain.com/garbage.html  and see what happens.</p>
<p>The user will get redirected to the home page of the site and an email  containing the error message will be sent to you.</p>
<p>Its now up to you to fix any errors that might occur and saves yourself  thousands of lost dollars in lost sales..</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Bruce Hearder owns and run <a href="http://www.WebsiteSecrets101.com" target="_self">http://www.WebsiteSecrets101.com</a></p>
<p>Sign up for the WebSiteSecrets101 newsletter, and learn the tricks webmasters use on their sites.</p>
]]></description>
		<wfw:commentRss>http://www.websitesecrets101.com/avoid-loosing-thousands-of-dollars-from-your-website/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
