<?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: Phusion, Rack, Sinatra, and sub-domains</title>
	<atom:link href="http://blog.ardekantur.com/2008/07/phusion-rack-sinatra-and-sub-domains/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ardekantur.com/2008/07/phusion-rack-sinatra-and-sub-domains/</link>
	<description>Computer Science, Ruby, and Software Engineering.</description>
	<pubDate>Tue, 06 Jan 2009 08:24:35 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ardekantur</title>
		<link>http://blog.ardekantur.com/2008/07/phusion-rack-sinatra-and-sub-domains/comment-page-1/#comment-2311</link>
		<dc:creator>Ardekantur</dc:creator>
		<pubDate>Tue, 09 Dec 2008 17:33:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ardekantur.com/?p=105#comment-2311</guid>
		<description>&lt;p&gt;To everyone who stumbles onto this post, I've started using a Sinatra before filter I found somewhere to take care of this for me on the application level:&lt;/p&gt;

&lt;p&gt;&lt;pre lang='ruby'&gt;
before do 
  # kill trailing slashes for all requests except '/'
  request.env['PATH_INFO'].gsub!(/\/$/, '') if request.env['PATH_INFO'] != '/'
end
&lt;/pre&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>To everyone who stumbles onto this post, I&#8217;ve started using a Sinatra before filter I found somewhere to take care of this for me on the application level:</p>

<p>

</p>
<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;">before <span style="color:#9966CC; font-weight:bold;">do</span> 
  <span style="color:#008000; font-style:italic;"># kill trailing slashes for all requests except '/'</span>
  request.<span style="color:#9900CC;">env</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'PATH_INFO'</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#CC0066; font-weight:bold;">gsub!</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span>\<span style="color:#006600; font-weight:bold;">/</span>$<span style="color:#006600; font-weight:bold;">/</span>, <span style="color:#996600;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">if</span> request.<span style="color:#9900CC;">env</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'PATH_INFO'</span><span style="color:#006600; font-weight:bold;">&#93;</span> != <span style="color:#996600;">'/'</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>


]]></content:encoded>
	</item>
	<item>
		<title>By: dubek</title>
		<link>http://blog.ardekantur.com/2008/07/phusion-rack-sinatra-and-sub-domains/comment-page-1/#comment-2310</link>
		<dc:creator>dubek</dc:creator>
		<pubDate>Tue, 09 Dec 2008 17:22:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ardekantur.com/?p=105#comment-2310</guid>
		<description>&lt;p&gt;Thanks.&lt;/p&gt;

&lt;p&gt;I solved it without disabling mod_autoindex, but by adding a rewrite rule which rewrites the trailing-slash URL to a non-trailing-slash URL (I don't need these two different endpoints).&lt;/p&gt;

&lt;p&gt;Just add these two lines inside your VirtualHost section:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;&lt;code&gt;RewriteEngine on
RewriteRule ^(/[^/]*)/$ $1 [R]
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks.</p>

<p>I solved it without disabling mod_autoindex, but by adding a rewrite rule which rewrites the trailing-slash URL to a non-trailing-slash URL (I don&#8217;t need these two different endpoints).</p>

<p>Just add these two lines inside your VirtualHost section:</p>

<p><pre><code>RewriteEngine on
RewriteRule ^(/[^/]*)/$ $1 [R]
</code></pre></p>]]></content:encoded>
	</item>
	<item>
		<title>By: adam</title>
		<link>http://blog.ardekantur.com/2008/07/phusion-rack-sinatra-and-sub-domains/comment-page-1/#comment-956</link>
		<dc:creator>adam</dc:creator>
		<pubDate>Mon, 28 Jul 2008 07:49:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ardekantur.com/?p=105#comment-956</guid>
		<description>&lt;p&gt;Thank you for this awesome post! I had been trying to figure this out with Camping ever since Phusion put Rack support into Passenger and was too dim to figure out what was going on. Thanks again!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thank you for this awesome post! I had been trying to figure this out with Camping ever since Phusion put Rack support into Passenger and was too dim to figure out what was going on. Thanks again!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Ardekantur</title>
		<link>http://blog.ardekantur.com/2008/07/phusion-rack-sinatra-and-sub-domains/comment-page-1/#comment-955</link>
		<dc:creator>Ardekantur</dc:creator>
		<pubDate>Sun, 27 Jul 2008 20:20:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ardekantur.com/?p=105#comment-955</guid>
		<description>&lt;p&gt;Hongli -&lt;/p&gt;

&lt;p&gt;Thanks for your quick response. I tried explicitly declaring RailsAllodModRewrite off in my VirtualHost configuration, since the documentation implies it's off by default, but no dice. Clearly it's some kind of bizarre configuration overlap. I'll try and see if I can narrow the problem down and provide a test case.&lt;/p&gt;

&lt;p&gt;As it turns out, disabling mod_autoindex solves the problem fairly succinctly, but I have no use for autoindex. I have no idea what would be done if someone did need it.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hongli -</p>

<p>Thanks for your quick response. I tried explicitly declaring RailsAllodModRewrite off in my VirtualHost configuration, since the documentation implies it&#8217;s off by default, but no dice. Clearly it&#8217;s some kind of bizarre configuration overlap. I&#8217;ll try and see if I can narrow the problem down and provide a test case.</p>

<p>As it turns out, disabling mod_autoindex solves the problem fairly succinctly, but I have no use for autoindex. I have no idea what would be done if someone did need it.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Hongli Lai</title>
		<link>http://blog.ardekantur.com/2008/07/phusion-rack-sinatra-and-sub-domains/comment-page-1/#comment-954</link>
		<dc:creator>Hongli Lai</dc:creator>
		<pubDate>Sun, 27 Jul 2008 20:06:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ardekantur.com/?p=105#comment-954</guid>
		<description>&lt;p&gt;/sinatra_test/ (with the trailing slash) is handled by Apache's directory handler. It's trying to display a directory index.&lt;/p&gt;

&lt;p&gt;I suppose this could be considered a "bug", but it's really quite a mess. There are so many combinations of Apache modules, that it's almost impossible to get everything right. Help/patches will be much appreciated.&lt;/p&gt;

&lt;p&gt;I believe the problem you experience only occurs if RailsAllowModRewrite is on.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>/sinatra_test/ (with the trailing slash) is handled by Apache&#8217;s directory handler. It&#8217;s trying to display a directory index.</p>

<p>I suppose this could be considered a &#8220;bug&#8221;, but it&#8217;s really quite a mess. There are so many combinations of Apache modules, that it&#8217;s almost impossible to get everything right. Help/patches will be much appreciated.</p>

<p>I believe the problem you experience only occurs if RailsAllowModRewrite is on.</p>]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.251 seconds -->
