<?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 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>Wed, 18 Nov 2009 23:28:48 -0500</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Chris Beck</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-104412</link>
		<dc:creator>Chris Beck</dc:creator>
		<pubDate>Thu, 24 Sep 2009 12:09:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-104412</guid>
		<description>Yeh... this is crazy advanced! Pretty awesome though.
</description>
		<content:encoded><![CDATA[<p>Yeh&#8230; this is crazy advanced! Pretty awesome though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AskApache</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-103287</link>
		<dc:creator>AskApache</dc:creator>
		<pubDate>Sat, 12 Sep 2009 23:27:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-103287</guid>
		<description>soma</description>
		<content:encoded><![CDATA[<p>soma</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fahed</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-103207</link>
		<dc:creator>Fahed</dc:creator>
		<pubDate>Sat, 12 Sep 2009 19:34:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-103207</guid>
		<description>In case this throws a 500 for anyone, make sure that mod_headers is loaded:


&lt;pre&gt;LoadModule headers_module modules/mod_headers.so&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>In case this throws a 500 for anyone, make sure that mod_headers is loaded:</p>
<pre>LoadModule headers_module modules/mod_headers.so</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Douglas Selph</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-99738</link>
		<dc:creator>Douglas Selph</dc:creator>
		<pubDate>Wed, 02 Sep 2009 21:37:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-99738</guid>
		<description>Okay, &lt;strong&gt;this looks very good&lt;/strong&gt;. I got it to work and display all the variables.

But what I *really* wanted was a way to print out the variables while accessing my problematic reference. That is, this prints out the variables using a specific URL request. Namely, test/index.php ... or whatever the name given to it was. But I want to see what&#039;s going on for the specific URL I am trying to debug. Is there a way from within the .htaccess file ALONE that I can print out the various variables?</description>
		<content:encoded><![CDATA[<p>Okay, <strong>this looks very good</strong>. I got it to work and display all the variables.</p>
<p>But what I *really* wanted was a way to print out the variables while accessing my problematic reference. That is, this prints out the variables using a specific URL request. Namely, test/index.php &#8230; or whatever the name given to it was. But I want to see what&#8217;s going on for the specific URL I am trying to debug. Is there a way from within the .htaccess file ALONE that I can print out the various variables?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bronius</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-94866</link>
		<dc:creator>bronius</dc:creator>
		<pubDate>Thu, 13 Aug 2009 18:48:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-94866</guid>
		<description>Kudos.  I love your style of writing-- very cheesy infomercial style.  Entertaining, informative, and it&#039;s not even 3am!</description>
		<content:encoded><![CDATA[<p>Kudos.  I love your style of writing&#8211; very cheesy infomercial style.  Entertaining, informative, and it&#8217;s not even 3am!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tulip</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-86731</link>
		<dc:creator>tulip</dc:creator>
		<pubDate>Wed, 08 Jul 2009 16:28:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-86731</guid>
		<description>I am new to apache mod_rewrite. I have a question here.
I would like to put an user defined variable in the RewriteRule, and the variable is retrieved from database. Is this possible?</description>
		<content:encoded><![CDATA[<p>I am new to apache mod_rewrite. I have a question here.<br />
I would like to put an user defined variable in the RewriteRule, and the variable is retrieved from database. Is this possible?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AskApache</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-68156</link>
		<dc:creator>AskApache</dc:creator>
		<pubDate>Thu, 05 Mar 2009 15:29:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-68156</guid>
		<description>&lt;strong&gt;@Michal&lt;/strong&gt;

Actually HTTP_ACCEPT_LANGUAGE, HTTP_ACCEPT, HTTP_HOST, HTTP_COOKIE, and a couple more variables are created by apache just for later referencer. In fact, HTTP_ACCEPT_LANGUAGE is an alias of &lt;code&gt;%{HTTP:Accept-Language}&lt;/code&gt;, but note that the %HTTP array holds the actual header strings, and some processing is done on it to create the HTTP_ variables. you can actualy access ANY header with the %HTTP variable, which is very neat because you can use that and the &lt;strong&gt;RequestHeader&lt;/strong&gt; directive as a data-channel/proxy... its crazy!

&lt;pre&gt;
RewriteRule .* - [E=INFO_UNIQUE_ID:%{UNIQUE_ID},NE]
RequestHeader set INFO_API_VERSION &quot;%{INFO_API_VERSION}e&quot;
&lt;/pre&gt;

I didn&#039;t explain in my post but basically this lets you examine the incoming request headers from the user (like Accept-Language) and then MODIFY their request headers before apache sees it. So if I were you I would perform regex on their incoming accept-language header, then modify their actual request to the real asset.</description>
		<content:encoded><![CDATA[<p><strong>@Michal</strong></p>
<p>Actually HTTP_ACCEPT_LANGUAGE, HTTP_ACCEPT, HTTP_HOST, HTTP_COOKIE, and a couple more variables are created by apache just for later referencer. In fact, HTTP_ACCEPT_LANGUAGE is an alias of <code>%{HTTP:Accept-Language}</code>, but note that the %HTTP array holds the actual header strings, and some processing is done on it to create the HTTP_ variables. you can actualy access ANY header with the %HTTP variable, which is very neat because you can use that and the <strong>RequestHeader</strong> directive as a data-channel/proxy&#8230; its crazy!</p>
<pre>RewriteRule .* - [E=INFO_UNIQUE_ID:%{UNIQUE_ID},NE]
RequestHeader set INFO_API_VERSION "%{INFO_API_VERSION}e"</pre>
<p>I didn&#8217;t explain in my post but basically this lets you examine the incoming request headers from the user (like Accept-Language) and then MODIFY their request headers before apache sees it. So if I were you I would perform regex on their incoming accept-language header, then modify their actual request to the real asset.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michał Borychowski</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-68020</link>
		<dc:creator>Michał Borychowski</dc:creator>
		<pubDate>Tue, 03 Mar 2009 14:54:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-68020</guid>
		<description>Thanks for great post, I didn&#039;t know it is possible to &quot;decode mod rewrite variables&#039; in this way!

I also found that &lt;code&gt;%{HTTP_ACCEPT_LANGUAGE}&lt;/code&gt; in .htaccess files for making multilingual websites doesn&#039;t work. However there is other way to read browser setting of prefferred language in order to make a localization of the site using Apache mod rewrite. 

Fortunately we can access every header sent by the browser using &lt;code&gt;%{HTTP:header}&lt;/code&gt;, so the solution is not &lt;code&gt;%{HTTP_ACCEPT_LANGUAGE}&lt;/code&gt; but: &lt;code&gt;%{HTTP:Accept-Language}&lt;/code&gt;. I write more about this on my blog post: &lt;a href=&quot;http://tech-blog.borychowski.com/index.php/2009/03/htaccess/redirect-according-to-browser-language-mod-rewrite-and-http_accept_language/&quot; rel=&quot;nofollow&quot;&gt;mod rewrite and HTTP_ACCEPT_LANGUAGE&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Thanks for great post, I didn&#8217;t know it is possible to &#8220;decode mod rewrite variables&#8217; in this way!</p>
<p>I also found that <code>%{HTTP_ACCEPT_LANGUAGE}</code> in .htaccess files for making multilingual websites doesn&#8217;t work. However there is other way to read browser setting of prefferred language in order to make a localization of the site using Apache mod rewrite. </p>
<p>Fortunately we can access every header sent by the browser using <code>%{HTTP:header}</code>, so the solution is not <code>%{HTTP_ACCEPT_LANGUAGE}</code> but: <code>%{HTTP:Accept-Language}</code>. I write more about this on my blog post: <a href="http://tech-blog.borychowski.com/index.php/2009/03/htaccess/redirect-according-to-browser-language-mod-rewrite-and-http_accept_language/" rel="nofollow">mod rewrite and HTTP_ACCEPT_LANGUAGE</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wes</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-47699</link>
		<dc:creator>Wes</dc:creator>
		<pubDate>Mon, 08 Dec 2008 01:51:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-47699</guid>
		<description>&lt;p&gt;For some reason, I&#039;m getting a 500 error. When I take out the &quot;RequestHeader&quot; portions of the .htaccess file, it actually brings me to the test/index.php file.&lt;/p&gt;

&lt;p&gt;Is there some configuration in my config file I need to do to allow RequestHeader code in .htaccess?&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>For some reason, I&#8217;m getting a 500 error. When I take out the &#8220;RequestHeader&#8221; portions of the .htaccess file, it actually brings me to the test/index.php file.</p>
<p>Is there some configuration in my config file I need to do to allow RequestHeader code in .htaccess?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Poojan Wagh</title>
		<link>http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html#comment-46618</link>
		<dc:creator>Poojan Wagh</dc:creator>
		<pubDate>Wed, 29 Oct 2008 17:31:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com/?p=1209#comment-46618</guid>
		<description>Your php code isn&#039;t showing completely. For some reason, WordPress (or whatever) is interpreting your piece of quoted php code (index.php), and cuts off part of it. I can see in the source that you have:


&lt;pre&gt;
$r)
{
  if(substr($v,0,9)==&#039;HTTP_INFO&#039;)
  {
    if(!empty($r))$INFO[substr($v,10)]=$r;
    else $MISS[substr($v,10)]=$r;
  }
}
&#160;
/* thanks Mike! */
ksort($INFO);
ksort($MISS);
ksort($_SERVER);
&#160;
echo &quot;Received These Variables:\n&quot;;
print_r($INFO);
&#160;
echo &quot;Missed These Variables:\n&quot;;
print_r($MISS);
&#160;
echo &quot;ALL Variables:\n&quot;;
print_r($_SERVER);
&lt;/pre&gt;

However, the &lt;?php is still being interpreted. The web page only lists from $r) onward. Maybe it&#039;s my firefox browser?</description>
		<content:encoded><![CDATA[<p>Your php code isn&#8217;t showing completely. For some reason, WordPress (or whatever) is interpreting your piece of quoted php code (index.php), and cuts off part of it. I can see in the source that you have:</p>
<pre>$r)
{
  if(substr($v,0,9)==&#039;HTTP_INFO&#039;)
  {
    if(!empty($r))$INFO[substr($v,10)]=$r;
    else $MISS[substr($v,10)]=$r;
  }
}
&nbsp;
/* thanks Mike! */
ksort($INFO);
ksort($MISS);
ksort($_SERVER);
&nbsp;
echo "Received These Variables:\n";
print_r($INFO);
&nbsp;
echo "Missed These Variables:\n";
print_r($MISS);
&nbsp;
echo "ALL Variables:\n";
print_r($_SERVER);</pre>
<p>However, the &lt;?php is still being interpreted. The web page only lists from $r) onward. Maybe it&#8217;s my firefox browser?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
