<?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>Tue, 20 Dec 2011 19:54:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>htaccess- 301 Redirect Old URLs With Spaces</title>
		<link>http://www.brightcherry.co.uk/scribbles/htaccess-301-redirect-old-urls-with-spaces/</link>
		<comments>http://www.brightcherry.co.uk/scribbles/htaccess-301-redirect-old-urls-with-spaces/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 00:50:19 +0000</pubDate>
		<dc:creator>adm1n</dc:creator>
				<category><![CDATA[htaccess fun]]></category>

		<guid isPermaLink="false">http://www.brightcherry.co.uk/scribbles/?p=416</guid>
		<description><![CDATA[Here&#8217;s a quick and easy htaccess 301 redirect tip. So, you have a URL like this: http://www.example.co.uk/this is_a_file.html and you want to redirect it to: http://www.example.co.uk/this_is_a_file.html All you need to is quote the URL like this: 1 Redirect 301 &#34;/this is_a_file.html&#34; http://www.example.co.uk/this_is_a_file.html]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick and easy htaccess 301 redirect tip.</p>
<p><b class="pink">So, you have a URL like this:</b><br />
http://www.example.co.uk/this is_a_file.html</p>
<p><b class="pink">and you want to redirect it to:</b></p>
<p>http://www.example.co.uk/this_is_a_file.html</p>
<p><b class="pink">All you need to is quote the URL like this:</b></p>

<div class="wp_codebox"><table><tr id="p4162"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p416code2"><pre class="php" style="font-family:monospace;">Redirect <span style="color: #cc66cc;">301</span> <span style="color: #0000ff;">&quot;/this is_a_file.html&quot;</span> http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.example.co.uk/this_is_a_file.html</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.brightcherry.co.uk/scribbles/htaccess-301-redirect-old-urls-with-spaces/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>htaccess- Hide File Extension</title>
		<link>http://www.brightcherry.co.uk/scribbles/htaccess-hide-file-extension/</link>
		<comments>http://www.brightcherry.co.uk/scribbles/htaccess-hide-file-extension/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 13:04:06 +0000</pubDate>
		<dc:creator>adm1n</dc:creator>
				<category><![CDATA[htaccess fun]]></category>

		<guid isPermaLink="false">http://www.brightcherry.co.uk/scribbles/?p=383</guid>
		<description><![CDATA[I only used this code for the first time last week, but seems to work pretty well. The same code is plastered all over the internet on various websites, so I&#8217;m only jotting it down for my own personal reference. Hiding File Extensions What this piece of htaccess code basically does is allow you to [...]]]></description>
			<content:encoded><![CDATA[<p>I only used this code for the first time last week, but seems to work pretty well. The same code is plastered all over the internet on various websites, so I&#8217;m only jotting it down for my own personal reference.</p>
<h4>Hiding File Extensions </h4>
<p>What this piece of htaccess code basically does is allow you to access files without needing to reference the file extension. For example, you call the following page <b class="pink">http://www.example.com/contact.php</b> by simply using <b class="pink">http://www.example.com/contact</b> (.php not require)</p>
<p>I think it&#8217;s pretty cool. It even allows you to pass variables through the URL without needing the file extension. For example, you can do the following, <b class="pink">http://www.example.com/contact?id=23</b></p>
<h4>The code</h4>
<p>Simply copy/paste the following into your htaccess file</p>

<div class="wp_codebox"><table><tr id="p3834"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p383code4"><pre class="php" style="font-family:monospace;">RewriteEngine On
RewriteCond <span style="color: #339933;">%</span><span style="color: #009900;">&#123;</span>REQUEST_FILENAME<span style="color: #009900;">&#125;</span> <span style="color: #339933;">!-</span>d
RewriteCond <span style="color: #339933;">%</span><span style="color: #009900;">&#123;</span>REQUEST_FILENAME<span style="color: #009900;">&#125;</span>\<span style="color: #339933;">.</span>php <span style="color: #339933;">-</span>f
RewriteRule ^<span style="color: #009900;">&#40;</span><span style="color: #339933;">.*</span><span style="color: #009900;">&#41;</span>$ <span style="color: #339933;">/</span>$<span style="color: #cc66cc;">1</span><span style="color: #339933;">.</span>php</pre></td></tr></table></div>

<p>The example is specifically removing &#8220;php&#8221; file extensions- you can change that to whichever you want, I assume. I&#8217;ve only used it with php files so far <img src='http://www.brightcherry.co.uk/scribbles/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightcherry.co.uk/scribbles/htaccess-hide-file-extension/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Htaccess- 301 Redirect An Entire Directory / Folder</title>
		<link>http://www.brightcherry.co.uk/scribbles/htaccess-301-redirect-an-entire-directory-folder/</link>
		<comments>http://www.brightcherry.co.uk/scribbles/htaccess-301-redirect-an-entire-directory-folder/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 23:07:00 +0000</pubDate>
		<dc:creator>adm1n</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"><table><tr id="p1846"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p184code6"><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/htaccess-301-redirect-an-entire-directory-folder/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Htaccess: Prevent People Hotlinking Your Images</title>
		<link>http://www.brightcherry.co.uk/scribbles/htaccess-prevent-people-hotlinking-your-images/</link>
		<comments>http://www.brightcherry.co.uk/scribbles/htaccess-prevent-people-hotlinking-your-images/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 23:49:10 +0000</pubDate>
		<dc:creator>adm1n</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. 1 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 that all [...]]]></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"><table><tr id="p1558"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p155code8"><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/htaccess-prevent-people-hotlinking-your-images/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

