<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Htaccess SetEnvIf and SetEnvIfNoCase Examples</title>
	<atom:link href="http://www.askapache.com/htaccess/setenvif.html/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.askapache.com/htaccess/setenvif.html</link>
	<description>Advanced Web Development</description>
	<lastBuildDate>Tue, 18 Jun 2013 10:04:02 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: AskApache</title>
		<link>http://www.askapache.com/htaccess/setenvif.html#comment-1620</link>
		<dc:creator>AskApache</dc:creator>
		<pubDate>Fri, 07 Oct 2011 17:20:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/htaccess/setenvif.html#comment-1620</guid>
		<description><![CDATA[&lt;p&gt;&lt;strong&gt;@ Philip Goddard&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Run another setenvif for those you want to allow, and make the action unset the spam_ref variable by prepending it with !.&lt;/p&gt;
&lt;pre&gt;setenvifnocase referer &quot;^http://.*(poker&#124;texas.?hold-?em&#124;diet&#124;loan&#124;cash&#124;video&#124;liftmaster&#124;fillbest&#124;pharma&#124;.info/)&quot; spam_ref=1
setenvifnocase referer &quot;^http://.*(google&#124;yahoo&#124;bing)&quot; !spam_ref
# (plus lots more similar lines)
Order Allow,Deny
Allow from all
Deny from env=spam_ref&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p><strong>@ Philip Goddard</strong></p>
<p>Run another setenvif for those you want to allow, and make the action unset the spam_ref variable by prepending it with !.</p>
<pre>setenvifnocase referer "^http://.*(poker|texas.?hold-?em|diet|loan|cash|video|liftmaster|fillbest|pharma|.info/)" spam_ref=1
setenvifnocase referer "^http://.*(google|yahoo|bing)" !spam_ref
# (plus lots more similar lines)
Order Allow,Deny
Allow from all
Deny from env=spam_ref</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Philip Goddard</title>
		<link>http://www.askapache.com/htaccess/setenvif.html#comment-1619</link>
		<dc:creator>Philip Goddard</dc:creator>
		<pubDate>Wed, 01 Dec 2010 10:24:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/htaccess/setenvif.html#comment-1619</guid>
		<description><![CDATA[I haven&#039;t been able to figure out how to make an exception when using the SetEnvIf directive.

I have in my .htaccess the following configuration to block unwanted visitors on the basis of referrer keywords:

&lt;pre&gt;setenvifnocase referer &quot;^http://.*(poker&#124;texas.?hold-?em&#124;diet&#124;loan&#124;cash&#124;video&#124;liftmaster&#124;fillbest&#124;pharma&#124;.info/)&quot; spam_ref=1
# (plus lots more similar lines)
Order Allow,Deny
Allow from all
Deny from env=spam_ref&lt;/pre&gt;



That works fine except that certain legitimate referrers such as Google can actually contain the odd word that is in the forbidden referrer keyword list and thus get blocked, and so I want to make an exception for them - to allow them even if they do contain one of the banned words. Any suggestions of solutions that have actually been tested and found to operate reliably? Thanks.]]></description>
		<content:encoded><![CDATA[<p>I haven't been able to figure out how to make an exception when using the SetEnvIf directive.</p>
<p>I have in my .htaccess the following configuration to block unwanted visitors on the basis of referrer keywords:</p>
<pre>setenvifnocase referer "^http://.*(poker|texas.?hold-?em|diet|loan|cash|video|liftmaster|fillbest|pharma|.info/)" spam_ref=1
# (plus lots more similar lines)
Order Allow,Deny
Allow from all
Deny from env=spam_ref</pre>
<p>That works fine except that certain legitimate referrers such as Google can actually contain the odd word that is in the forbidden referrer keyword list and thus get blocked, and so I want to make an exception for them - to allow them even if they do contain one of the banned words. Any suggestions of solutions that have actually been tested and found to operate reliably? Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: damu</title>
		<link>http://www.askapache.com/htaccess/setenvif.html#comment-1618</link>
		<dc:creator>damu</dc:creator>
		<pubDate>Thu, 05 Aug 2010 00:59:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/htaccess/setenvif.html#comment-1618</guid>
		<description><![CDATA[can we do something like this:

AuthUserFile /web/XYZ/passwd/.htpasswd


AuthUserFile /web/XYZ2/passwd/.htpasswd]]></description>
		<content:encoded><![CDATA[<p>can we do something like this:</p>
<p>AuthUserFile /web/XYZ/passwd/.htpasswd</p>
<p>AuthUserFile /web/XYZ2/passwd/.htpasswd</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcello</title>
		<link>http://www.askapache.com/htaccess/setenvif.html#comment-1617</link>
		<dc:creator>Marcello</dc:creator>
		<pubDate>Mon, 14 Sep 2009 09:52:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/htaccess/setenvif.html#comment-1617</guid>
		<description><![CDATA[I don&#039;t understand this

&lt;pre&gt;SetEnvIfNoCase ^If-Modified-Since$ &quot;(.+)&quot; HTTP_IF_MODIFIED_SINCE=$1&lt;/pre&gt;


shouldn&#039;t there be a variable in place of &lt;code&gt;^If-Modified-Since$&lt;/code&gt; ? otherwise it will always match..]]></description>
		<content:encoded><![CDATA[<p>I don't understand this</p>
<pre>SetEnvIfNoCase ^If-Modified-Since$ "(.+)" HTTP_IF_MODIFIED_SINCE=$1</pre>
<p>shouldn't there be a variable in place of <code>^If-Modified-Since$</code> ? otherwise it will always match..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Average Joe</title>
		<link>http://www.askapache.com/htaccess/setenvif.html#comment-1616</link>
		<dc:creator>Average Joe</dc:creator>
		<pubDate>Wed, 25 Mar 2009 23:38:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/htaccess/setenvif.html#comment-1616</guid>
		<description><![CDATA[Your article and site is helpful, but the music is rude, annoying, poor design and dis-tasteful. Everyone likes their own music, and usually respect one another&#039;s tastes. Please respect your visitors and let us listen to our own music, not yours. DJ&#039;ing should be left for radio hosts and party&#039;s. Thanks.]]></description>
		<content:encoded><![CDATA[<p>Your article and site is helpful, but the music is rude, annoying, poor design and dis-tasteful. Everyone likes their own music, and usually respect one another's tastes. Please respect your visitors and let us listen to our own music, not yours. DJ'ing should be left for radio hosts and party's. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Emmanuel Mwangi</title>
		<link>http://www.askapache.com/htaccess/setenvif.html#comment-1615</link>
		<dc:creator>Emmanuel Mwangi</dc:creator>
		<pubDate>Mon, 29 Dec 2008 00:52:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/htaccess/setenvif.html#comment-1615</guid>
		<description><![CDATA[&lt;p&gt;I would like to be able to make .htaccess directives on a number of sites I have version control systems.  I have a copy of the site on my computer hosted on my local apache set to hostname.dev while that site is live on the net as hostname.com or .org.&lt;/p&gt;

&lt;p&gt;Right now, I can&#039;t keep the .htaccess file in version control because it differs greatly from my host&#039;s setup (the &lt;em&gt;excellent&lt;/em&gt; &lt;strong&gt;Dreamhost&lt;/strong&gt;) with my own setup (Apache2+PHP5 on OSX Leopard on a MBP).  I had thought of trying to duplicate Dreamhosts&#039; environment (just for fun) but, that&#039;s more trouble than it is worth in both fun and profit.&lt;/p&gt;

&lt;p&gt;So, I was looking for a way to have environment variables trigger various rules in .htaccess.  I found this site (&lt;em&gt;great btw&lt;/em&gt;) and I was looking for solution.  I was thinking that there would be some way to trigger blocks of commands with directives from server variables.  Something along these lines:&lt;/p&gt;

&lt;code&gt;  DEVELOPMENT (MACBOOK APACHE SETUP) RULES...
  ...
  PRODUCTION (DREAMHOST) RULES...&lt;/code&gt;]]></description>
		<content:encoded><![CDATA[<p>I would like to be able to make .htaccess directives on a number of sites I have version control systems.  I have a copy of the site on my computer hosted on my local apache set to hostname.dev while that site is live on the net as hostname.com or .org.</p>
<p>Right now, I can't keep the .htaccess file in version control because it differs greatly from my host's setup (the <em>excellent</em> <strong>Dreamhost</strong>) with my own setup (Apache2+PHP5 on OSX Leopard on a MBP).  I had thought of trying to duplicate Dreamhosts' environment (just for fun) but, that's more trouble than it is worth in both fun and profit.</p>
<p>So, I was looking for a way to have environment variables trigger various rules in .htaccess.  I found this site (<em>great btw</em>) and I was looking for solution.  I was thinking that there would be some way to trigger blocks of commands with directives from server variables.  Something along these lines:</p>
<p><code>  DEVELOPMENT (MACBOOK APACHE SETUP) RULES...<br />
  ...<br />
  PRODUCTION (DREAMHOST) RULES...</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bay islands</title>
		<link>http://www.askapache.com/htaccess/setenvif.html#comment-1614</link>
		<dc:creator>bay islands</dc:creator>
		<pubDate>Fri, 19 Sep 2008 08:42:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/htaccess/setenvif.html#comment-1614</guid>
		<description><![CDATA[I think Baidu spider is now legit. I saw a thread at &lt;a href=&quot;http://www.webmasterworld.com&quot; rel=&quot;nofollow&quot;&gt;webmasterworld&lt;/a&gt; where the baidu techs came and went through why they were ok.]]></description>
		<content:encoded><![CDATA[<p>I think Baidu spider is now legit. I saw a thread at <a href="http://www.webmasterworld.com" rel="nofollow">webmasterworld</a> where the baidu techs came and went through why they were ok.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
