Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Making symbolic linked Rails apps work when folder accessed with no trailing slash (See related posts)

Snippets is at bigbold.com/snippets/ but bigbold.com/snippets always failed with "Bad Request". bigbold.com/snippets always seemed to rewrite into 'snippets.html' for some reason, so this change to .htaccess cures it:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !snippets\.html
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteRule snippets\.html /snippets/ [R]


Replace snippets with the name of your own folder, obviously.

Comments on this post

technoweenie posts on Aug 06, 2005 at 16:11
Thanks! I thought your site was having major problems, but my RSS feed kept working...
thelovebug posts on Aug 19, 2005 at 08:21
Thanks for posting this. 2 years of searching for a snippet of directives that would do that... I know I should have asked you first!
JamesCrisp posts on Aug 19, 2006 at 11:52
I tried your solution but didn't have any luck on my host (jumba.com.au).. after a lot of banging my head against the wall, I came up with this solution:

RewriteRule ^.*myapp$ http://%{HTTP_HOST}/myapp/ [R=301,L]


where 'myapp' is the name of the application. It's now working at last :-)

Cheers,
James

You need to create an account or log in to post comments to this site.


Click here to browse all 4861 code snippets

Related Posts