DZone 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

Snippets has posted 5883 posts at DZone. View Full User Profile

Making Symbolic Linked Rails Apps Work When Folder Accessed With No Trailing Slash

  • submit to reddit
        Snippets is at but always failed with "Bad Request". 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.    


Snippets Manager replied on Sat, 2006/08/19 - 10:46am

I tried your solution but didn't have any luck on my host ( 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

Snippets Manager replied on Mon, 2012/05/07 - 1:13pm

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!

Snippets Manager replied on Mon, 2012/05/07 - 1:13pm

Thanks! I thought your site was having major problems, but my RSS feed kept working...