<?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>Cheap Web Hosting Blog &#187; .htaccess</title>
	<atom:link href="http://www.cheap-webhosting.in/blog/category/htaccess/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cheap-webhosting.in/blog</link>
	<description>Hosting tips for webmasters and admins</description>
	<lastBuildDate>Thu, 29 Oct 2009 01:00:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Redirect to www. with htaccess part II</title>
		<link>http://www.cheap-webhosting.in/blog/redirect-to-www-with-htaccess-part-ii/</link>
		<comments>http://www.cheap-webhosting.in/blog/redirect-to-www-with-htaccess-part-ii/#comments</comments>
		<pubDate>Tue, 08 May 2007 21:59:39 +0000</pubDate>
		<dc:creator>Hostmaster</dc:creator>
				<category><![CDATA[.htaccess]]></category>

		<guid isPermaLink="false">http://www.cheap-webhosting.in/blog/redirect-to-www-with-htaccess-part-ii/</guid>
		<description><![CDATA[There is a very handy plugin written by Mark Jaquith that allows you to redirect to www. with a convenient wordpress plugin. Many people including myself set up their blog and then realise later that itÂ´s set up to ignore the www. Obviously, if youÂ´re really slow (like me) you only realise once youÂ´ve got [...]]]></description>
			<content:encoded><![CDATA[<p>There is a very handy plugin written by Mark Jaquith that allows you to <a href="http://txfx.net/code/wordpress/enforce-www-preference/" target="_blank">redirect to www.</a> with a convenient wordpress plugin. Many people including myself set up their blog and then realise later that itÂ´s set up to ignore the www. Obviously, if youÂ´re really slow (like me) you only realise once youÂ´ve got quite a few incoming links.</p>
<p>MarkÂ´s plugin ensures that your blog pages don&#8217;t lose page rank and that you will get a clean 301 redirect which is search engine friendly and will make the Googlebot rejoice.</p>
<p>In an earlier post I already gave you the plain .htaccess method for <a href="http://cheap-webhosting.in/blog/redirect-to-www-with-htaccess/" target="_blank">enforcing www</a>.</p>
<p>At the moment IÂ´m also looking into a PHP method to achieve the same goal with headers but that is still being tested. IÂ´ll keep you posted.</p>
<p>P.s. When you are messing around with .htaccess and you delete your directives and the redirection still seems to persist you need to clear your browser cache! Took me a whole day to figure this out&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cheap-webhosting.in/blog/redirect-to-www-with-htaccess-part-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making a custom 404 error page</title>
		<link>http://www.cheap-webhosting.in/blog/making-a-custom-404-error-page/</link>
		<comments>http://www.cheap-webhosting.in/blog/making-a-custom-404-error-page/#comments</comments>
		<pubDate>Mon, 16 Apr 2007 22:06:43 +0000</pubDate>
		<dc:creator>Hostmaster</dc:creator>
				<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[HostingTips]]></category>

		<guid isPermaLink="false">http://cheap-webhosting.in/blog/making-a-custom-404-error-page/</guid>
		<description><![CDATA[404 Page not Found errors will not only annoy your visitors but if you have too many they can also hurt your rankings in the search engines. With AWStats you can see where a 404 error occurs and eliminate it. If you build a custom 404 error page you can inform visitors that they page [...]]]></description>
			<content:encoded><![CDATA[<p>404 Page not Found errors will not only annoy your visitors but if you have too many they can also hurt your rankings in the search engines. With <a href="http://cheap-webhosting.in/blog/awstats-introduction-and-hosting/" title="Read my AWSTATS introduction">AWStats</a> you can see where a 404 error occurs and eliminate it. If you build a custom 404 error page you can inform visitors that they page that they wanted to access doesnÂ´t exist and give them an opportunity to return to the home page.</p>
<p>You need access to the .htaccess file:</p>
<p>In there put this line:   ErrorDocument 404 /error.html</p>
<p>You can give this any name you like but really 404.html, notfound.html, error.html would make most sense to indicate through the url what this page is about.</p>
<p>Next create your error.html page with a link, your logo etc. just be creative and you will have a good chance of keeping some of those visitors on your site.  If you have a search box you could include that as well and maybe a link to your sitemap. There are usually two philosophies to designing a custom 404 page. One option would be to keep the usual design and just put a 404 message in the middle column for instance. Another would be to have a different page style where you just keep your logo, a centered error message and a link back to the homepage.</p>
<p>Make sure that all links that you use are absolute. I.e. use something like http://www.yoursite.com/articles/index.html instead of just /articles/index.html . As your 404s may sometimes be caused from within the CGI bin or other locations relative urls spell trouble. And you donÂ´t want to provoke 404s from within your 404 page, now do you <img src='http://www.cheap-webhosting.in/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ?</p>
<p>All you need to do now is to upload your .htaccess file and your error.html .</p>
<p>The following <a href="http://www.cheap-webhosting.in/">affordable web hosts</a> provide a .htaccess file which you will need to setup your custom 404 error page:</p>
<p><a href="http://www.bluehost.com/track/signup/404" target="_blank" rel="nofollow"> Bluehost</a> &#8211; read about <a href="http://cheap-webhosting.in/blog/bluehost-upgrades/" target="_blank">bluehostÂ´s recent upgrade</a><br />
<a href="http://secure.hostgator.com/cgi-bin/affiliates/clickthru.cgi?id=signon&amp;campaign=404" target="_blank" rel="nofollow"> Hostgator</a><br />
<a href="http://secure.hostican.com/cgi-bin/affiliates/clickthru.cgi?id=hofmax&amp;campaign=404" target="_blank" rel="nofollow">HostIcan</a><a href="http://www.hostmonster.com/track/signup01/404" target="_blank" rel="nofollow"><br />
Hostmonster</a> -read my post &#8220;<a href="http://cheap-webhosting.in/blog/bluehost-and-hostmonster-same-company/" target="_blank">bluehost hostmonster same company</a>&#8221; they also upgraded their plan<br />
<a href="http://partners.ipower.com/z/51/CD5437/" target="_blank" rel="nofollow"> IPowerweb</a><br />
<a href="http://www.lunarpages.com/id/revhost&amp;campaign=404" target="_blank" rel="nofollow"> Lunarpages</a><br />
<a href="http://www.powweb.com/join/index.bml?AffID=564002&amp;LinkName=404" target="_blank" rel="nofollow"> Powweb</a><br />
<a href="http://network.startlogic.com/z/7/CD112/" target="_blank" rel="nofollow"> Startlogic</a></p>
<p>More detailed reviews can be found in my <a href="http://www.cheap-webhosting.in/" target="_blank">cheap web hosting review</a> articles.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cheap-webhosting.in/blog/making-a-custom-404-error-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redirect to www with .htaccess</title>
		<link>http://www.cheap-webhosting.in/blog/redirect-to-www-with-htaccess/</link>
		<comments>http://www.cheap-webhosting.in/blog/redirect-to-www-with-htaccess/#comments</comments>
		<pubDate>Sat, 14 Apr 2007 19:58:30 +0000</pubDate>
		<dc:creator>Hostmaster</dc:creator>
				<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[HostingTips]]></category>

		<guid isPermaLink="false">http://cheap-webhosting.in/blog/redirect-to-www-with-htaccess/</guid>
		<description><![CDATA[The prefix www in web hyperlinks is becoming obsolete but a lot of people still like using it. So in order to avoid a 404 when someone tries to type in a http://yourhomepage.com you will need to setup a redirection to http://www.yourhomepage.com in your .htaccess file. This is the code you will need to enter: [...]]]></description>
			<content:encoded><![CDATA[<p>The prefix www in web hyperlinks is becoming obsolete but a lot of people still like using it. So in order to avoid a 404 when someone tries to type in a http://yourhomepage.com you will need to setup a redirection to http://www.yourhomepage.com in your .htaccess file. This is the code you will need to enter:</p>
<p>Options +FollowSymlinks<br />
RewriteEngine on<br />
rewritecond %{http_host} ^yourhomepage.com [nc]<br />
rewriterule ^(.*)$ http://www.yourhomepage.com/$1 [r=301,nc]</p>
<p>This also ensures that you donÂ´t lose page rank through links pointing to  http://yourhomepage.com instead of http://www.yourhomepage.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cheap-webhosting.in/blog/redirect-to-www-with-htaccess/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hotlinking and addon domains</title>
		<link>http://www.cheap-webhosting.in/blog/hotlinking-and-addon-domains/</link>
		<comments>http://www.cheap-webhosting.in/blog/hotlinking-and-addon-domains/#comments</comments>
		<pubDate>Tue, 03 Apr 2007 21:08:37 +0000</pubDate>
		<dc:creator>Hostmaster</dc:creator>
				<category><![CDATA[.htaccess]]></category>

		<guid isPermaLink="false">http://cheap-webhosting.in/blog/hotlinking-and-addon-domains/</guid>
		<description><![CDATA[If you host more than one domain on one account your hotlinking protection on the main domain can become a problem with your addon domains. The hotlink protected file types will not show up in your addon domains. I had this problem recently at bluehost and I am going to share how you can get [...]]]></description>
			<content:encoded><![CDATA[<p>If you host more than one domain on one account your hotlinking protection on the main domain can become a problem with your addon domains. The hotlink protected file types will not show up in your addon domains. I had this problem recently at <a href="http://www.bluehost.com/track/signup/hadd" target="_blank" rel="nofollow">bluehost</a> and I am going to share how you can get round this problem.</p>
<p>First things first &#8211; how do you set up hotlinking protection. In CPanel click on the corresponding link and choose the site you want to enable it for. Next just add the excluded  file types and you are done. This is the hotlinking protection for one domain but what if you have more than one domain on one account? Just enable it for all three. Doing this through CPanel can get messy so we go directly to the .htaccess in your httpdocs directory.</p>
<p>In there you will find code which will look something like this:</p>
<p>RewriteEngine on<br />
RewriteCond %{HTTP_REFERER} !^http://maindomain.com/.*$      [NC]<br />
RewriteCond %{HTTP_REFERER} !^http://maindomain.com$      [NC]<br />
RewriteCond %{HTTP_REFERER} !^http://www.maindomain.com/.*$      [NC]<br />
RewriteCond %{HTTP_REFERER} !^http://www.maindomain.com$      [NC]<br />
RewriteRule .*\.(jpg|jpeg|gif|swf|dcr|png|bmp.*)$ http://www.nytimes.com/ [R,NC]</p>
<p>Now to take care of more than one addon domain just insert the following. In my case I set this up for two addon domains. By the way, yes I am redirecting hot link attempts to the NYTimes. After all bandwidth thieves should stay in touch with current affairs as well <img src='http://www.cheap-webhosting.in/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>RewriteCond %{HTTP_REFERER} !^http://maindomain.com/.*$      [NC]<br />
RewriteCond %{HTTP_REFERER} !^http://maindomain.com$      [NC]<br />
RewriteCond %{HTTP_REFERER} !^http://www.maindomain.com/.*$      [NC]<br />
RewriteCond %{HTTP_REFERER} !^http://www.maindomain.com$      [NC]<br />
RewriteCond %{HTTP_REFERER} !^http://addondomain1.com/.*$      [NC]<br />
RewriteCond %{HTTP_REFERER} !^http://addondomain1.com$      [NC]<br />
RewriteCond %{HTTP_REFERER} !^http://www.addondomain1.com/.*$      [NC]<br />
RewriteCond %{HTTP_REFERER} !^http://www.addondomain1.com$      [NC]<br />
RewriteCond %{HTTP_REFERER} !^http://addondomain2.com/.*$      [NC]<br />
RewriteCond %{HTTP_REFERER} !^http://addondomain2.com$      [NC]<br />
RewriteCond %{HTTP_REFERER} !^http://www.addondomain2.com/.*$      [NC]<br />
RewriteCond %{HTTP_REFERER} !^http://www.addondomain2.com$      [NC]<br />
RewriteRule .*\.(jpg|jpeg|gif|swf|dcr|png|bmp.*)$ http://www.nytimes.com/ [R,NC]</p>
<p>So what&#8217;s the fuzz about? Well, as I stated before if you just install hotlinking on your top level domain then you won&#8217;t be able to use images on the addon domains beneath it unless you activate the hotlinking protection for them as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cheap-webhosting.in/blog/hotlinking-and-addon-domains/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
