<?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>Nomulous Blog &#187; regex</title>
	<atom:link href="http://nomulous.com/blog/tag/regex/feed/" rel="self" type="application/rss+xml" />
	<link>http://nomulous.com/blog</link>
	<description>Caveat Lector</description>
	<lastBuildDate>Sat, 17 Jul 2010 04:43:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>From &#8220;removeUnexpectedACL&#8221; to &#8220;ACLr8&#8243;</title>
		<link>http://nomulous.com/blog/from-removeunexpectedacl-to-aclr8/</link>
		<comments>http://nomulous.com/blog/from-removeunexpectedacl-to-aclr8/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 22:07:35 +0000</pubDate>
		<dc:creator>nomulous</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[acl]]></category>
		<category><![CDATA[aclr8]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[chmod]]></category>
		<category><![CDATA[disk utility]]></category>
		<category><![CDATA[diskutil]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[permissions]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[repair]]></category>
		<category><![CDATA[unexpected]]></category>
		<category><![CDATA[verify]]></category>

		<guid isPermaLink="false">http://nomulous.com/blog/?p=79</guid>
		<description><![CDATA[I just received a huge shipment of cheese and I don&#8217;t know what to do with it. So, I&#8217;ll be changing the name of the ACL tool from &#8220;removeUnexpectedACL&#8221; to &#8220;ACLr8&#8243;. But who cares? Download ACLr8 here. Update: ACLr8 now has its own page here.]]></description>
			<content:encoded><![CDATA[<p>I just received a huge shipment of cheese and I don&#8217;t know what to do with it. So, I&#8217;ll be changing the name of the ACL tool from &#8220;removeUnexpectedACL&#8221; to &#8220;ACLr8&#8243;. But who cares?</p>
<p><del datetime="2009-09-07T06:24:05+00:00">Download ACLr8 here.</del><br />
<strong>Update:</strong> ACLr8 now has its own page <a href="http://nomulous.com/ACLr8/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nomulous.com/blog/from-removeunexpectedacl-to-aclr8/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How to avoid looping in mod_rewrite redirection</title>
		<link>http://nomulous.com/blog/how-to-avoid-looping-in-mod_rewrite-redirection/</link>
		<comments>http://nomulous.com/blog/how-to-avoid-looping-in-mod_rewrite-redirection/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 05:40:54 +0000</pubDate>
		<dc:creator>nomulous</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[500]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[internal server error]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[mod rewrite]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[request uri]]></category>
		<category><![CDATA[rewrite]]></category>
		<category><![CDATA[rewritecond]]></category>

		<guid isPermaLink="false">http://nomulous.com/blog/?p=66</guid>
		<description><![CDATA[When redirecting things to a new location that fits the original rewrite pattern, you end up with a recursive feedback loop and all you get is an error. If you specified a URL scheme and a domain in your rewrite (meaning that the redirection is visible to the browser) you&#8217;ll see the error in your [...]]]></description>
			<content:encoded><![CDATA[<p>When redirecting things to a new location that fits the original rewrite pattern, you end up with a recursive feedback loop and all you get is an error. If you specified a URL scheme and a domain in your rewrite (meaning that the redirection is visible to the browser) you&#8217;ll see the error in your browser saying something along the lines of &#8220;the page tried to redirect too many times&#8221;. Otherwise, the redirection will be internal, and you&#8217;ll get your server&#8217;s 500 Internal Server Error page.</p>
<p style="text-align: center;"><a href="http://nomulous.com/blog/wp-content/uploads/2009/06/redirect_loop_safari.png"><img class="aligncenter size-full wp-image-71" title="redirect_loop_safari" src="http://nomulous.com/blog/wp-content/uploads/2009/06/redirect_loop_safari.png" alt="redirect_loop_safari" width="478" height="236" /></a></p>
<p>So, how do you avoid it? Well, say you wanted to redirect some regex (regular expression) pattern to the your index page, say index.php, but it turns out that &#8220;index.php&#8221; actually matches your pattern, so index.php redirects to index.php which redirects to index.php, and so on, and so forth.</p>
<p>To prevent this, simply add a RewriteCond that checks the REQUEST_URI to make sure it doesn&#8217;t match the string that you redirect to. The following is an example.</p>
<p><code>RewriteCond %{REQUEST_URI} !^/?index.php$<br />
RewriteRule ^(regex|goes|here)$ /index.php</code></p>
<p>Just make sure the regex in the first part does <em>not</em> match any of the pages you want to redirect, and that&#8217;s it! You&#8217;re done.</p>
<p>Best of luck on getting this to work the way you want it to, and happy web developing!</p>
]]></content:encoded>
			<wfw:commentRss>http://nomulous.com/blog/how-to-avoid-looping-in-mod_rewrite-redirection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
