Forum: Ruby on Rails Trailing Slash Problems with Deployment on Shared Hosting Us

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7015d9823ff88386740b630c89e9971b?d=identicon&s=25 TeeC (Guest)
on 2007-02-07 03:13
(Received via mailing list)
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
This topic is locked and can not be replied to.