<?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>Two Drifters &#187; BlogDesk</title>
	<atom:link href="http://blog.ideaday.de/max/tag/blogdesk/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ideaday.de/max</link>
	<description>Off to see the world.</description>
	<lastBuildDate>Sun, 05 Feb 2012 16:48:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>mod_rewrite and Concrete5</title>
		<link>http://blog.ideaday.de/max/2010/01/mod_rewrite-and-concrete5/</link>
		<comments>http://blog.ideaday.de/max/2010/01/mod_rewrite-and-concrete5/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 18:31:40 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[Concrete 5]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[BlogDesk]]></category>
		<category><![CDATA[Concrete5]]></category>

		<guid isPermaLink="false">http://blog.ideaday.de/max/2010/01/mod_rewrite-and-concrete5/</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2010/01/mod_rewrite-and-concrete5/' addthis:title='mod_rewrite and Concrete5 '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>I was trying to additionally rewrite an URL before letting the classical Concrete5 mod_rewrite happen &#8211; everything matched to index.php, like so: &#60;IfModule mod_rewrite.c&#62; RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] &#60;/IfModule&#62; Íf you try to paste any additional RewriteRule before this catch-all rule, your Apache will run [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2010/01/mod_rewrite-and-concrete5/' addthis:title='mod_rewrite and Concrete5 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2010/01/mod_rewrite-and-concrete5/' addthis:title='mod_rewrite and Concrete5 '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>I was trying to additionally rewrite an URL before letting the classical Concrete5 mod_rewrite happen &#8211; everything matched to index.php, like so:</p>
<blockquote>
<p>&lt;IfModule mod_rewrite.c&gt;<br />
 RewriteEngine On<br />
 RewriteBase /</p>
<p> RewriteCond %{REQUEST_FILENAME} !-f<br />
 RewriteCond %{REQUEST_FILENAME} !-d</p>
<p> RewriteRule ^(.*)$ index.php/$1 [L]<br />
&lt;/IfModule&gt;</p>
</blockquote>
<p>Íf you try to paste <strong>any additional</strong> RewriteRule <strong>before</strong> this catch-all rule, your Apache will run into an endless loop, probably giving up with a <strong>500 error</strong>. Your log will show something like:</p>
<blockquote>
<p><em>access.log</em></p>
<p>(&#8230;) "GET" "114.ideaday.de" "/stellenmarkt/stellenangebote/" "redirect<strong>:/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/</strong>stellenmarkt/stellenangebote/"<br />
<em>error.log</em></p>
<p>[Sun Jan 24 16:57:52 2010] [error] [client 85.181.108.54] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.</p>
</blockquote>
<p>Apparently mod_rewrite fails to recognize index.php as already being rewritten and keeps looping through the rule over and over again. Recent versions of Apache will stop after 10 iterations and yield a 500 error.<br />
After nearly giving up, I've figured out a solution how to do this:</p>
<blockquote>
<p>&lt;IfModule mod_rewrite.c&gt;<br />
 RewriteEngine On<br />
 RewriteBase /</p>
<p> RewriteRule ^stellenmarkt/stellengesuche/(.*)-([0-9]+)[/]*$ stellenmarkt/stellengesuche/gdemo/?id=$2 [L,QSA]</p>
<p> RewriteCond %{REQUEST_FILENAME} !-f<br />
 RewriteCond %{REQUEST_FILENAME} !-d</p>
<p> RewriteRule ^(.*)$ index.php/$1 [L]<br />
&lt;/IfModule&gt;</p>
</blockquote>
<p>As you see, the additional rule is placed <strong>before</strong> the Rewrite Conditions! This works, no more endless loops :-)</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2010/01/mod_rewrite-and-concrete5/' addthis:title='mod_rewrite and Concrete5 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ideaday.de/max/2010/01/mod_rewrite-and-concrete5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 1/13 queries in 0.006 seconds using disk: basic
Object Caching 311/336 objects using disk: basic
Content Delivery Network via ideadayblog.ideaday.netdna-cdn.com

Served from: blog.ideaday.de @ 2012-02-06 18:58:21 -->
