<?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>damonky.co.uk &#187; security</title>
	<atom:link href="http://www.damonky.co.uk/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.damonky.co.uk</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 04 Apr 2010 19:31:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Conditional Authentication using .htaccess</title>
		<link>http://www.damonky.co.uk/general/conditional-authentication-using-htaccess/</link>
		<comments>http://www.damonky.co.uk/general/conditional-authentication-using-htaccess/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 13:15:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.damonky.co.uk/?p=239</guid>
		<description><![CDATA[Working on sites very close to live is always tricky. Clients want to use the site unhindered, you want to check it through before it goes live. The one thing you don&#8217;t want happen is for the public to discover and access the site before it goes live.
The code below allows only grant access without [...]]]></description>
			<content:encoded><![CDATA[<p>Working on sites very close to live is always tricky. Clients want to use the site unhindered, you want to check it through before it goes live. The one thing you don&#8217;t want happen is for the public to discover and access the site before it goes live.</p>
<p>The code below allows only grant access without authentication to a set of IP&#8217;s / domains. Any request from a  domain not in this list will be asked to authenticate. Satisfy any allows the .htaccess to grant permission to anyone who meets the two key criteria. In the example you will note that google&#8217;s domains have been allowed through so as not to affect SEO too much. Replace 123.123.123.123 with your IP, or that of whoever you wish to access the site. I am yet however to find one that works for dynamic IP&#8217;s &#8211; wouldn&#8217;t that be neat <img src='http://www.damonky.co.uk/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>You will of course need to create a .htpasswd file. a good generator can be found at http://www.htaccesstools.com/htpasswd-generator/ along with a load of other goodies.</p>
<p><code lang="bash[lines]">#require authentication of requests<br />
AuthName "Restricted Area"<br />
AuthUserFile /var/www/.htpasswd<br />
AuthType basic<br />
Require valid-user<br />
#deny access to all, allow for selected ip's / domains<br />
Order Deny,Allow<br />
Deny from all<br />
Allow from 123.123.123.123 googlebot.com google.com google-analytics.com<br />
#if any of these rules are satisfied they may proceed<br />
Satisfy Any<br />
</code></p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=df7f5442-f312-8b95-82c0-76017cd15ab0" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.damonky.co.uk/general/conditional-authentication-using-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
