<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>ThomasLoudon.com comments on Problems with Mint on Typo</title>
    <link>http://thomasloudon.com/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>ThomasLoudon.com comments</description>
    <item>
      <title>"Problems with Mint on Typo" by tom</title>
      <description>&lt;p&gt;&lt;a href="http://haveamint.com/"&gt;&lt;img src="/images/articles/mint.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://haveamint.com"&gt;Mint&lt;/a&gt; is a wonderful statistics package and if you haven&amp;#8217;t tried it out yet I seriously suggest you do.&lt;/p&gt;


	&lt;p&gt;However, when installing Mint on a &lt;a href="http://typoshpere.org"&gt;Typo&lt;/a&gt; weblog some users may have encountered an interesting problem. When entering &lt;code&gt;http://yoursite/mint&lt;/code&gt; you get a 404 File not Found. However if you enter &lt;code&gt;http://yoursite/mint/index.php&lt;/code&gt;  it all works fine.&lt;/p&gt;


	&lt;p&gt;The problem arises because &lt;a href="http://rubyonrails.com/"&gt;Rails&lt;/a&gt; is trying to map the directory &lt;code&gt;mint&lt;/code&gt; to a controller. We want Rails to ignore the &lt;code&gt;mint&lt;/code&gt; directory so that we can see it. This is a rather straightforward task.&lt;/p&gt;


	&lt;p&gt;The answer can be found on the &lt;a href="http://www.haveamint.com/forum/viewtopic.php?pid=6066#p6066"&gt;Mint forum&lt;/a&gt;. Paste the following code into your &lt;code&gt;.htaccess&lt;/code&gt; file which is in the &lt;code&gt;public&lt;/code&gt; directory.&lt;/p&gt;


&lt;pre&gt;
RewriteCond %{REQUEST_URI} ^/mint.*
RewriteRule .* - [L]
&lt;/pre&gt;

	&lt;p&gt;That&amp;#8217;s it. You needn&amp;#8217;t do any more. If you want to know what is going on then keep reading.&lt;/p&gt;


	&lt;h3&gt;RewriteCond&lt;/h3&gt;


	&lt;p&gt;The line beginning &lt;a href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html#RewriteCond"&gt;RewriteCond&lt;/a&gt; defines a condition for the the &lt;a href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html#RewriteRule"&gt;RewriteRule&lt;/a&gt; it precedes. The condition takes two pieces of information. The first is a string to test and the second is the pattern to look for in the test string.&lt;/p&gt;


	&lt;p&gt;The &lt;code&gt;%{REQUEST_URI}&lt;/code&gt; string is a server variable, in this case the &lt;span class="caps"&gt;URI&lt;/span&gt; entered into the browser by the user. The &lt;code&gt;^/mint.*&lt;/code&gt; string is the pattern to test for. The pattern specifies that the requested &lt;span class="caps"&gt;URI&lt;/span&gt; start with the string &lt;code&gt;/mint&lt;/code&gt; and has anything following it.&lt;/p&gt;


	&lt;h3&gt;RewriteRule&lt;/h3&gt;


	&lt;p&gt;The next line, beginning &lt;a href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html#RewriteRule"&gt;RewriteRule&lt;/a&gt; specifies that the request should not be directed anywhere. The &lt;code&gt;.&lt;/code&gt; (period), according to the &lt;a href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html"&gt;mod_rewrite documentation&lt;/a&gt;, means &amp;#8220;Any single character&amp;#8221;. Therefore a request for &lt;code&gt;/mint&lt;/code&gt; does not get redirected.&lt;/p&gt;


	&lt;p&gt;The last bit &lt;code&gt;[L]&lt;/code&gt; stops the rewriting ending the condition.&lt;/p&gt;


	&lt;h3&gt;Bibliography &amp;#38; Useful Links&lt;/h3&gt;


	&lt;ol&gt;
	&lt;li&gt;&lt;a href="http://www.haveamint.com/forum/viewtopic.php?pid=6066#p6066"&gt;Typo (Ruby on Rails) : Configuring Mint&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html"&gt;Module mod_rewrite
&lt;span class="caps"&gt;URL &lt;/span&gt;Rewriting Engine&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://httpd.apache.org/docs/2.2/misc/rewriteguide.html"&gt;URL Rewriting Guide&lt;/a&gt;&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;If anyone has any links they think might be useful, feel free to post them. Any corrections to the article are more than welcome, I&amp;#8217;m no expert.&lt;/p&gt;

</description>
      <pubDate>Mon,  8 May 2006 06:24:00 PDT</pubDate>
      <guid>&lt;a href="/articles/2006/05/08/typo-mint-problems"&gt;Problems with Mint on Typo&lt;/a&gt;</guid>
      <link>&lt;a href="/articles/2006/05/08/typo-mint-problems"&gt;Problems with Mint on Typo&lt;/a&gt;</link>
    </item>
  </channel>
</rss>
