<?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>Bright Cherry &#187; htaccess fun</title>
	<atom:link href="http://www.brightcherry.co.uk/scribbles/category/htaccess-fun/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brightcherry.co.uk/scribbles</link>
	<description></description>
	<lastBuildDate>Fri, 27 Aug 2010 18:00:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Htaccess- 301 Redirect An Entire Directory / Folder</title>
		<link>http://www.brightcherry.co.uk/scribbles/2009/09/19/htaccess-301-redirect-an-entire-directory-folder/</link>
		<comments>http://www.brightcherry.co.uk/scribbles/2009/09/19/htaccess-301-redirect-an-entire-directory-folder/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 23:07:00 +0000</pubDate>
		<dc:creator>Maruf</dc:creator>
				<category><![CDATA[htaccess fun]]></category>

		<guid isPermaLink="false">http://www.brightcherry.co.uk/scribbles/?p=184</guid>
		<description><![CDATA[Here&#8217;s a simple pierce of code which will permanently redirect a folder / directory. For example, if you have a directory in the following path: http://www.example.com/pictures/, and for whatever reason decide to rename the directory to http://www.example.com/new-pictures/, the following htaccess code will safely redirect all users from /pictures/ to /new-pictures/ Redirect An Entire Directory / [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a simple pierce of code which will permanently redirect a folder / directory. For example, if you have a directory in the following path: <b class="pink">http://www.example.com/pictures/</b>, and for whatever reason decide to rename the directory to <b class="pink">http://www.example.com/new-pictures/</b>, the following htaccess code will safely redirect all users from <b class="pink">/pictures/</b> to <b class="pink">/new-pictures/</b></p>
<h4>Redirect An Entire Directory / Folder with Htaccess</h4>

<div class="wp_codebox_msgheader"><span class="right"><sup></sup></span><span class="left"><a rel="nofollow" href="javascript:;" onclick="javascript:showCodeTxt('p184code2'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p1842"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p184code2"><pre class="php" style="font-family:monospace;">RewriteEngine on
RewriteBase <span style="color: #339933;">/</span>
RewriteRule ^old_dir<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">.*</span><span style="color: #009900;">&#41;</span> http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.example.com/new_dir/ [R=301,L]</span></pre></td></tr></table></div>

<p>The nice thing about this code is that regardless of how deep you go into old_dir, it will always redirect. So literally the entire directory is redirected.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightcherry.co.uk/scribbles/2009/09/19/htaccess-301-redirect-an-entire-directory-folder/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Htaccess: Prevent People Hotlinking Your Images</title>
		<link>http://www.brightcherry.co.uk/scribbles/2009/08/22/htaccess-prevent-people-hotlinking-your-images/</link>
		<comments>http://www.brightcherry.co.uk/scribbles/2009/08/22/htaccess-prevent-people-hotlinking-your-images/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 23:49:10 +0000</pubDate>
		<dc:creator>Maruf</dc:creator>
				<category><![CDATA[htaccess fun]]></category>

		<guid isPermaLink="false">http://www.brightcherry.co.uk/scribbles/?p=155</guid>
		<description><![CDATA[Here&#8217;s some Htaccess code that will prevent people from hotlinking images hosted on your server. Simply change the domain to yours and then apply the code to your .htaccess. It&#8217;s as easy as that. View Code PHP1 2 3 RewriteCond %&#123;HTTP_REFERER&#125; !^$ RewriteCond %&#123;HTTP_REFERER&#125; !^http&#40;s&#41;?://(.*\.)?brightcherry.co.uk [NC] RewriteRule \.&#40;jpeg&#124;jpg&#124;gif&#124;png&#41;$ - &#91;F&#93; The code is basically saying [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s some Htaccess code that will prevent people from hotlinking images hosted on your server. Simply change the domain to yours and then apply the code to your .htaccess. It&#8217;s as easy as that.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup></sup></span><span class="left"><a rel="nofollow" href="javascript:;" onclick="javascript:showCodeTxt('p155code4'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p1554"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p155code4"><pre class="php" style="font-family:monospace;">RewriteCond <span style="color: #339933;">%</span><span style="color: #009900;">&#123;</span>HTTP_REFERER<span style="color: #009900;">&#125;</span> <span style="color: #339933;">!</span>^$  
RewriteCond <span style="color: #339933;">%</span><span style="color: #009900;">&#123;</span>HTTP_REFERER<span style="color: #009900;">&#125;</span> <span style="color: #339933;">!</span>^http<span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#41;</span>?<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//(.*\.)?brightcherry.co.uk [NC]  </span>
RewriteRule \<span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span>jpeg<span style="color: #339933;">|</span>jpg<span style="color: #339933;">|</span>gif<span style="color: #339933;">|</span>png<span style="color: #009900;">&#41;</span>$ <span style="color: #339933;">-</span> <span style="color: #009900;">&#91;</span>F<span style="color: #009900;">&#93;</span></pre></td></tr></table></div>

<p>The code is basically saying that all jpg, gif and png files hosted on brightcherry.co.uk can only be displayed on brightcherry.co.uk. Anyone else that tries to hotlink it will see a X.</p>
<h4>Why would you want to prevent people from hotlinking?</h4>
<p>There are many reasons, but the main two I can think of are:</p>
<ul>
<li>Prevents copyright infringement</li>
<li>Reduces data transfer. If someone hotlinks one of your images onto a website that receives heavy traffic, it will be your server that&#8217;s sending the data. That could specifically be costly for Admins that don&#8217;t have unlimited data transfer allowance.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.brightcherry.co.uk/scribbles/2009/08/22/htaccess-prevent-people-hotlinking-your-images/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
