<?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>The Web Development Blog &#187; htaccess</title>
	<atom:link href="http://www.thewebdevelopmentblog.com/category/htaccess/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thewebdevelopmentblog.com</link>
	<description>News, tips, scripts and tutorials for web developers.</description>
	<lastBuildDate>Thu, 25 Aug 2011 11:15:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>.htaccess: Disabling access to browse files on directories</title>
		<link>http://www.thewebdevelopmentblog.com/2009/02/tip-htaccess-disabling-access-to-browse-files-on-directories/</link>
		<comments>http://www.thewebdevelopmentblog.com/2009/02/tip-htaccess-disabling-access-to-browse-files-on-directories/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 06:56:55 +0000</pubDate>
		<dc:creator>Jason Stockton</dc:creator>
				<category><![CDATA[htaccess]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://thewebdevelopmentblog.com/?p=170</guid>
		<description><![CDATA[Some web hosts (including mine up until recently) allow users to browse files on a particular directory on your website. Although this is handy for you in development to check if files have actually uploaded or whatever else. But of course you don&#8217;t want everyone else being able to browse through your files, thankfully there [...]]]></description>
			<content:encoded><![CDATA[<p>Some web hosts (including mine up until recently) allow users to browse files on a particular directory on your website. Although this is handy for you in development to check if files have actually uploaded or whatever else. But of course you don&#8217;t want everyone else being able to browse through your files, thankfully there is a short code you can add to your .htaccess files which will block access to browsing these directories.</p>
<p><span id="more-170"></span></p>
<p><strong>Add the code to your .htaccess file</strong></p>
<p>To block access to browsing files on directories you can simply add the code below to your .htaccess file:</p>
<p><code>IndexIgnore *</code></p>
<p>That&#8217;s all! Then if people enter the url of a directory on your website it will no longer list the files in that directory.</p>
<p>Don&#8217;t know how to set-up a .htaccess file? <a title="Setting up a .htaccess file" href="http://thewebdevelopmentblog.com/2009/02/htaccess-tip-1-redirecting-no-www-to-www/" target="_blank">Click here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thewebdevelopmentblog.com/2009/02/tip-htaccess-disabling-access-to-browse-files-on-directories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.htaccess: redirecting no www. to www.</title>
		<link>http://www.thewebdevelopmentblog.com/2009/02/htaccess-tip-1-redirecting-no-www-to-www/</link>
		<comments>http://www.thewebdevelopmentblog.com/2009/02/htaccess-tip-1-redirecting-no-www-to-www/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 13:09:37 +0000</pubDate>
		<dc:creator>Jason Stockton</dc:creator>
				<category><![CDATA[htaccess]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[coda]]></category>
		<category><![CDATA[redirection]]></category>

		<guid isPermaLink="false">http://thewebdevelopmentblog.com/?p=165</guid>
		<description><![CDATA[The .htaccess is a powerful tool when it comes to managing server-side actions. It is a common comment that sites that have both www.domain.com and domain.com can get penalised from search engines because they are seen as 2 different websites. Personally I think this theory is a bit silly and you&#8217;d think search engines such [...]]]></description>
			<content:encoded><![CDATA[<p>The .htaccess is a powerful tool when it comes to managing server-side actions. It is a common comment that sites that have both www.domain.com and domain.com can get penalised from search engines because they are seen as 2 different websites. Personally I think this theory is a bit silly and you&#8217;d think search engines such as google would be smarter than that. Never the less, site addresses should probably be consistent anyway. Using .htaccess you can redirect traffic that goes to domain.com to www.domain.com &#8211; thus fixing the search engine problem and making your domain consistant to all visitors.</p>
<p><span id="more-165"></span></p>
<p><strong>Add the code to the .htaccess file</strong></p>
<p>To redirect visitors from the www.-less domain we add the following code to our .htaccess file:</p>
<p><code>Options +FollowSymlinks<br />
</code><code>RewriteEngine on<br />
</code><code>RewriteCond %{http_host} ^<em>yourdomain</em>.com [nc]<br />
</code><code>RewriteRule ^(.*)$ http://www.<em>yourdomain</em>.com/$1 [r=301,nc]</code></p>
<p>Make sure you replace yourdomain.com with your domain. This is all you need to do! Easy!</p>
<p><strong>About .htaccess files</strong></p>
<p>.htaccess files have a number of uses, from changing apache set-ups to editing php settings. It&#8217;s quite useful however it can be a fiddly process. The reason the files start with a &#8220;.&#8221; instead of having the normal format is because they typically are hidden files. Linux and Mac OS X typically treat these files as hidden. If you edit locally this can cause problems if you haven&#8217;t set your computer to show hidden files. Programs such as <a title="Coda for Mac OS X from Panic" href="http://www.panic.com/coda/" target="_blank">Coda</a> allow you to show/edit these hidden files inside it&#8217;s file browser.</p>
<p>I recently had a series of my sites hacked with .htaccess files that added a series of porn links to my site in the source code (the sites remained as were). It&#8217;s a really tricky thing to discover as they were old sites that I don&#8217;t commonly edit so it wasn&#8217;t until it was pointed out to me that I found it out. So if you have a similar hack done to one of your sites delete the .htaccess file!</p>
<p><strong>Setting up a .htaccess file</strong></p>
<p>Easy, just create a file called .htaccess in your favourite text editor. Save it to the root directory of your domain (or the directory you wish the actions to occur). If it doesn&#8217;t work, make sure your server has .htaccess scripting allowed.</p>
<p>I&#8217;ve got a lot more .htaccess tips to share so keep a look out.</p>
<p><strong> </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thewebdevelopmentblog.com/2009/02/htaccess-tip-1-redirecting-no-www-to-www/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

