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
.htaccess That Fixes The Trailing Slash Error
// This .htaccess file is for use with a Rails application that is accessed by a symbolic link. This fixes an error in which the directory URL must have a trailing slash. Otherwise, the user receives a 400 Bad Request error.
Options +FollowSymLinks +ExecCGI
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} -d
RewriteCond %{SCRIPT_FILENAME} ^.*[^\/]$
RewriteRule ^(.*)$ $1/ [N]
#Put the directory your Rails app is in here.
RewriteBase /directory
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.cgi?$1 [QSA,L]






Comments
Snippets Manager replied on Mon, 2012/05/07 - 2:34pm
Snippets Manager replied on Mon, 2012/05/07 - 2:34pm