Trailing Slash Problems with Deployment on Shared Hosting Us


#1

Hi,

I’ve been trying to deploy a simple Rails app for a friend on a shared
hosting account. I was able to get the Rails application running, but
the URL need to end in a slash or else it would result in a 400 Bad
Request error. After searching through the Rails I wiki found a page
on the exact same error (http://wiki.rubyonrails.com/rails/show/Non
+VHost+Installation, it’s toward the bottom of the page). I tried the
suggestions there, and they allowed the app to load without the
trailing slash, but when the slash was on the URL it resulted in a 400
error.
Has anyone had success with similar problems?

Here’s my .htaccess file:
Options +FollowSymLinks +ExecCGI

RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} -d
RewriteCond %{SCRIPT_FILENAME} ^.[^/]$
RewriteRule ^(.
)$ $1/ [N]

RewriteBase /photos

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.cgi?$1 [QSA,L