<?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: Crazy Advanced Mod_Rewrite Debug Tutorial</title>
	<atom:link href="http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html</link>
	<description>Advanced Web Development</description>
	<lastBuildDate>Thu, 16 May 2013 00:37:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Scott Laughton</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-14711</link>
		<dc:creator>Scott Laughton</dc:creator>
		<pubDate>Wed, 17 Apr 2013 01:34:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-14711</guid>
		<description><![CDATA[What a great service to the developer community!!  Thanks heaps!!]]></description>
		<content:encoded><![CDATA[<p>What a great service to the developer community!!  Thanks heaps!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephan H. Wissel</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-3334</link>
		<dc:creator>Stephan H. Wissel</dc:creator>
		<pubDate>Wed, 05 Dec 2012 17:40:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-3334</guid>
		<description><![CDATA[&lt;p&gt;I&#039;m trying to use ErrorDocument and mod_rewrite to do a lookup in a map first to see if there is a known replacement URL (&lt;a href=&quot;http://serverfault.com/questions/449278/preserving-urls-after-cms-migration-with-redirect-database-and-apache-http&quot;&gt;I asked on severfault&lt;/a&gt;). My &lt;code&gt;/var/www/errormap.map&lt;/code&gt; file looks like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/demo.html /test/found.html&lt;/code&gt; (before I compiled it).  My apache settings like this:&lt;/p&gt;
&lt;pre&gt;ErrorDocument 404 /error.html
RewriteEngine on
RewriteMap lowercase int:tolower
RewriteMap error-map dbm:/var/www/errormap.map
RewriteRule ^/error.html ${error-map:${lowercase:%{REQUEST_URI}}&#124;/test/notfound.html} [R,NC,L]&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;%{REQUEST_URI}&lt;/code&gt; doesn&#039;t seem to work. If I hardcode &lt;code&gt;/demo.html&lt;/code&gt; there, the lookup works. What do I miss? Loading a module? Using a different variable? Dark magic indeed.&lt;/p&gt;]]></description>
		<content:encoded><![CDATA[<p>I'm trying to use ErrorDocument and mod_rewrite to do a lookup in a map first to see if there is a known replacement URL (<a href="http://serverfault.com/questions/449278/preserving-urls-after-cms-migration-with-redirect-database-and-apache-http">I asked on severfault</a>). My <code>/var/www/errormap.map</code> file looks like this:</p>
<p><code>/demo.html /test/found.html</code> (before I compiled it).  My apache settings like this:</p>
<pre>ErrorDocument 404 /error.html
RewriteEngine on
RewriteMap lowercase int:tolower
RewriteMap error-map dbm:/var/www/errormap.map
RewriteRule ^/error.html ${error-map:${lowercase:%{REQUEST_URI}}|/test/notfound.html} [R,NC,L]</pre>
<p>The <code>%{REQUEST_URI}</code> doesn't seem to work. If I hardcode <code>/demo.html</code> there, the lookup works. What do I miss? Loading a module? Using a different variable? Dark magic indeed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NameMike</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-2814</link>
		<dc:creator>NameMike</dc:creator>
		<pubDate>Tue, 17 Jul 2012 19:50:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-2814</guid>
		<description><![CDATA[Hi Ralph, thanks for publishing this!

I was hoping to see in this list the last-modified date of the requested file, but I don&#039;t see it here. Is there any way to pull this information into .htaccess?

Mike]]></description>
		<content:encoded><![CDATA[<p>Hi Ralph, thanks for publishing this!</p>
<p>I was hoping to see in this list the last-modified date of the requested file, but I don't see it here. Is there any way to pull this information into .htaccess?</p>
<p>Mike</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NameOliver</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-2813</link>
		<dc:creator>NameOliver</dc:creator>
		<pubDate>Wed, 20 Jun 2012 13:06:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-2813</guid>
		<description><![CDATA[Still haven&#039;t got a ******* clue. Is there an idiots guide somewhere?]]></description>
		<content:encoded><![CDATA[<p>Still haven't got a ******* clue. Is there an idiots guide somewhere?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sabine</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-2812</link>
		<dc:creator>Sabine</dc:creator>
		<pubDate>Thu, 29 Dec 2011 13:57:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-2812</guid>
		<description><![CDATA[Where can I donate? This article is the missing link of all mod_rewrite so called documentation. Thank you so much!]]></description>
		<content:encoded><![CDATA[<p>Where can I donate? This article is the missing link of all mod_rewrite so called documentation. Thank you so much!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam KopeÄ‡</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-2811</link>
		<dc:creator>Adam KopeÄ‡</dc:creator>
		<pubDate>Wed, 24 Aug 2011 09:33:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-2811</guid>
		<description><![CDATA[Bookmarked. Forever.

Big thanks, man.]]></description>
		<content:encoded><![CDATA[<p>Bookmarked. Forever.</p>
<p>Big thanks, man.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad Neuberg</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-2810</link>
		<dc:creator>Brad Neuberg</dc:creator>
		<pubDate>Wed, 10 Aug 2011 00:14:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-2810</guid>
		<description><![CDATA[&lt;p&gt;Note that for some reason the original error status trick wasn&#039;t working for me if I followed it with an [L]; I had to use [PT] to pass the request back through. Here&#039;s an example of my code to return a 409 when certain headers are present:&lt;/p&gt;

&lt;pre&gt;ErrorDocument 409 /error_file_conflict.json
Redirect 409 /trigger-error/409
RewriteCond %{REQUEST_URI} ^/files/([^/]+)/trunk/head/.*$
RewriteCond %{REQUEST_METHOD} ^PUT$
RewriteCond %{HTTP:X-Subversion-Revision} !283
Header set X-Subversion-Revision 283
RewriteRule ^.*$ /trigger-error/409 [PT]&lt;/pre&gt;
&lt;p&gt;Notice the [PT] at the very end. Here&#039;s an example &lt;strong&gt;cURL&lt;/strong&gt; request that now correctly works with this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;curl http://api-local.inkling.com/files/ganongs_physiology_23e/trunk/head/s9ml/chapter04/ch04_1_testfigure_4-4.s9ml -i -H &quot;Content-Type: text/xml&quot; -H &quot;X-Subversion-Revision: 282&quot; -X PUT&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It took me forever to find this, so posting in case it helps other people :)&lt;/p&gt;

&lt;p&gt;Best,
  Brad Neuberg&lt;/p&gt;]]></description>
		<content:encoded><![CDATA[<p>Note that for some reason the original error status trick wasn't working for me if I followed it with an [L]; I had to use [PT] to pass the request back through. Here's an example of my code to return a 409 when certain headers are present:</p>
<pre>ErrorDocument 409 /error_file_conflict.json
Redirect 409 /trigger-error/409
RewriteCond %{REQUEST_URI} ^/files/([^/]+)/trunk/head/.*$
RewriteCond %{REQUEST_METHOD} ^PUT$
RewriteCond %{HTTP:X-Subversion-Revision} !283
Header set X-Subversion-Revision 283
RewriteRule ^.*$ /trigger-error/409 [PT]</pre>
<p>Notice the [PT] at the very end. Here's an example <strong>cURL</strong> request that now correctly works with this:</p>
<p><code>curl http://api-local.inkling.com/files/ganongs_physiology_23e/trunk/head/s9ml/chapter04/ch04_1_testfigure_4-4.s9ml -i -H "Content-Type: text/xml" -H "X-Subversion-Revision: 282" -X PUT</code></p>
<p>It took me forever to find this, so posting in case it helps other people :)</p>
<p>Best,<br />
  Brad Neuberg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-2809</link>
		<dc:creator>Greg</dc:creator>
		<pubDate>Wed, 06 Jul 2011 20:06:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-2809</guid>
		<description><![CDATA[So I have an interesting situation. I have two webservers running as virtual hosts. Site1 and Site2 - they both run on the same set of hardware and both use the same IP address.

When someone comes into &lt;code&gt;Site2/site.gateway.html$&lt;/code&gt; I need them to proxy to &lt;code&gt;Site1/site.gateway.html$1&lt;/code&gt;.
&lt;pre&gt;RewriteCond %{REQUEST_URI} ^/site.gateway.html$
RewriteRule ^(.*)$ http://Site1$1 [NE,P]&lt;/pre&gt;
Throws an error of:
&lt;blockquote cite=&quot;apache&quot;&gt;
&lt;p&gt;Your browser sent a request that this server could not understand.
Size of a request header field exceeds server limit.
X-Forwarded-Host: site1, site1, site1 ...&lt;/p&gt;
&lt;/blockquote&gt;


The thing is, I have to have &quot;&lt;tt&gt;ProxyPreserveHost On&lt;/tt&gt;&quot; because of other &lt;var&gt;mod_proxy&lt;/var&gt; directives. Any ideas? I am thrown on this one.]]></description>
		<content:encoded><![CDATA[<p>So I have an interesting situation. I have two webservers running as virtual hosts. Site1 and Site2 - they both run on the same set of hardware and both use the same IP address.</p>
<p>When someone comes into <code>Site2/site.gateway.html$</code> I need them to proxy to <code>Site1/site.gateway.html$1</code>.</p>
<pre>RewriteCond %{REQUEST_URI} ^/site.gateway.html$
RewriteRule ^(.*)$ http://Site1$1 [NE,P]</pre>
<p>Throws an error of:</p>
<blockquote cite="apache">
<p>Your browser sent a request that this server could not understand.<br />
Size of a request header field exceeds server limit.<br />
X-Forwarded-Host: site1, site1, site1 ...</p>
</blockquote>
<p>The thing is, I have to have "<tt>ProxyPreserveHost On</tt>" because of other <var>mod_proxy</var> directives. Any ideas? I am thrown on this one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pelle</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-2808</link>
		<dc:creator>Pelle</dc:creator>
		<pubDate>Wed, 29 Jun 2011 15:07:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-2808</guid>
		<description><![CDATA[Cheers,

thanks for the awesome insights on mod_rewrite. Found this article while searching for information about the &lt;var&gt;IS_SUBREQ&lt;/var&gt; variable. Still I couldn&#039;t find out, when exactly this variable is set to true. Could you maybe enlighten me?

Thanks a lot, Pelle.]]></description>
		<content:encoded><![CDATA[<p>Cheers,</p>
<p>thanks for the awesome insights on mod_rewrite. Found this article while searching for information about the <var>IS_SUBREQ</var> variable. Still I couldn't find out, when exactly this variable is set to true. Could you maybe enlighten me?</p>
<p>Thanks a lot, Pelle.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abdelkarim</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-2807</link>
		<dc:creator>Abdelkarim</dc:creator>
		<pubDate>Wed, 04 May 2011 06:49:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-2807</guid>
		<description><![CDATA[I&#039;m lost.

In my problem need to change the variables &lt;var&gt;SERVER_NAME&lt;/var&gt; and &lt;var&gt;HTTP_POST&lt;/var&gt;, because these variables Akamai gives me the name of the original machine.

With these valuesâ€‹â€‹, the Joomla rewrite, I change the URL for these values.

I tried:

&lt;pre&gt;SERVER_ADDR SetEnvIf 192  .168  .74  .142 SERVER_NAME = i.like.this.name.com
&#160;
RewriteRule .* - [E = SERVER_NAME &quot;i.like.this.name.com, NE]
&#160;
RequestHeader set SERVER_NAME &quot;i.like.this.name.com&quot;&lt;/pre&gt;

In this case if I create a variable, &lt;code&gt;HTTP_SERVER_NAME&lt;/code&gt; but not changing the value of &lt;code&gt;SERVER_NAME&lt;/code&gt;

No positive result.]]></description>
		<content:encoded><![CDATA[<p>I'm lost.</p>
<p>In my problem need to change the variables <var>SERVER_NAME</var> and <var>HTTP_POST</var>, because these variables Akamai gives me the name of the original machine.</p>
<p>With these valuesâ€‹â€‹, the Joomla rewrite, I change the URL for these values.</p>
<p>I tried:</p>
<pre>SERVER_ADDR SetEnvIf 192  .168  .74  .142 SERVER_NAME = i.like.this.name.com
&nbsp;
RewriteRule .* - [E = SERVER_NAME "i.like.this.name.com, NE]
&nbsp;
RequestHeader set SERVER_NAME "i.like.this.name.com"</pre>
<p>In this case if I create a variable, <code>HTTP_SERVER_NAME</code> but not changing the value of <code>SERVER_NAME</code></p>
<p>No positive result.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
