<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Drinkingbird: Fix the Apache trailing slash problem</title>
    <link>http://www.drinkingbird.net/blog/articles/2007/06/17/fix-the-apache-trailing-slash-problem</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Random keyboard peckings</description>
    <item>
      <title>Fix the Apache trailing slash problem</title>
      <description>&lt;p&gt;After a lot of stuffing about I finally found a solution to the problem that I was having with the URL for this blog.&lt;/p&gt;

&lt;p&gt;The basic problem was that the link http://www.drinkingbird.net/blog (without the trailing slash) was being rejected with a &lt;code&gt;400 Bad Request&lt;/code&gt; error.&lt;/p&gt;

&lt;p&gt;I spent ages trying to get this to work with awkward rewrite rules in the parent directory, when I should have been looking in the public directory of the rails app. The solution is well enough explained over at &lt;a href="http://www.lavafactory.com/articles/2006/09/27/how-to-fix-the-trailing-slash-problem-with-apache-rails"&gt;LavaFactory&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I just made one small refinement, which is to change:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;RewriteRule .*/blog/(.*) http://www.drinkingbird.net/blog/$1 [L,R]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;to&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;RewriteRule (.*)/blog/(.*) $1/blog/$2&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;to satisfy my relentless desire to avoid configuration tied to a particular domain.&lt;/p&gt;</description>
      <pubDate>Sun, 17 Jun 2007 05:48:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:5f8e6bb8-4051-4087-92d6-cc9708c077ac</guid>
      <author>Chris</author>
      <link>http://www.drinkingbird.net/blog/articles/2007/06/17/fix-the-apache-trailing-slash-problem</link>
      <category>Typo</category>
      <category>Ruby on Rails</category>
    </item>
  </channel>
</rss>
