<?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>TecReviews.net &#187; Hosting</title>
	<atom:link href="http://tecreviews.net/category/hosting/feed/" rel="self" type="application/rss+xml" />
	<link>http://tecreviews.net</link>
	<description>Design - Code - Inspire</description>
	<lastBuildDate>Thu, 13 Aug 2009 15:16:49 +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>Custom 404 Pages</title>
		<link>http://tecreviews.net/hosting/custom-404-pages/</link>
		<comments>http://tecreviews.net/hosting/custom-404-pages/#comments</comments>
		<pubDate>Sat, 22 Nov 2008 23:48:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[server admin]]></category>

		<guid isPermaLink="false">http://tecreviews.net/?p=116</guid>
		<description><![CDATA[Something I found surprisingly difficult to find on the net is how to add custom 404 pages to your main and sub domains. A lot of people are scared of customising their pages due to the complicated nature of regular expression matching and .htaccess files. So, what are 404 pages? If you try to browse [...]]]></description>
			<content:encoded><![CDATA[<p>Something I found surprisingly difficult to find on the net is how to add custom 404 pages to your main and sub domains. A lot of people are scared of customising their pages due to the complicated nature of regular expression matching and .htaccess files.</p>
<p>So, what are 404 pages? If you try to browse to a non-existent page, this will cause a 404 error on the server and you will be directed to a 404 page. The problem arises for some when the server redirects your visitor to a 404 page they want to see rather than the one that you want. Take a look at a hostgator 404 page:</p>
<p><a href="http://avg.urlseek.vmn.net/search.php?lg=en&amp;mkt=en&amp;type=404&amp;tb=ff&amp;tbn=avg&amp;q=web"><img class="alignnone size-full wp-image-118" style="border: 1px solid black;" title="4041" src="http://tecreviews.net/wp-content/uploads/2008/11/4041.jpg" alt="" width="500" height="354" /></a></p>
<p>Not pretty, is it? This is a clever way for hostgator to make money on your sites and even direct traffic away from your site. Read on to see how to create your own custom 404 page and keep visitors at your site.</p>
<p><span id="more-116"></span></p>
<p>You will nees file access to your sites root directory. After you browse to this directory you will see a file named <strong>.htaccess</strong>. If you use a putty client to log in, use the <strong>ls -al </strong>command not <strong>ls -l</strong> to view the file.</p>
<p>Open the .htaccess file for editing and  add the following code:</p>
<p><code>RewriteEngine On<br />
RewriteCond %{HTTP_HOST} ^yoursite.com$ [OR]<br />
RewriteCond %{HTTP_HOST} ^www.yoursite.com/directory$<br />
RewriteRule ^(.*)$ "http\:\/\/www\.yoursite\.com\/directory" [R=301,L]<br />
ErrorDocument 404 http://www.yoursite.com/directory/404.shtml</code></p>
<p>Don&#8217;t worry about the code too much. For now just change the &#8220;yoursite.com&#8221;  and &#8220;directory&#8221; to match your site and directory of the root of your site. Leave the directory out if your site is installed in the root of your server.</p>
<p>Notice the last line of the code has the path to the 404 file. Now, create a file called <strong>404.shtml</strong>, and add your 404 text, e.g. &#8216;File not Found&#8217;. And that&#8217;s it! To test, browse to a non-existant page on your site and you should see the text you entered in the 404.shtml page. It&#8217;s a bit bare, but you can now customise it to suit the look and feel of your site.</p>
]]></content:encoded>
			<wfw:commentRss>http://tecreviews.net/hosting/custom-404-pages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
