overstimulate

DirectoryIndex + FastCGI in Typo

Thu, 25 Aug 2005 htaccess comments

I was having problems with my project pages (such as SVG Sparklines in javascript working after I switched from lighttpd to apache. After a month, and a few gentle prods from others to put up the work again, I spent some time to figure out what was wrong.

Inside the .htaccess file, the line:

RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

was causing all requests to be forwarded to the rail's dispatcher. When the dispatcher failed (for instance looking for a url that is really on the file system, not inside the rails app) it wouldn't server the index.html as the DirectoryIndex, so I would see a generic error.

My fix is a hack - I modified the RewriteRule to only use the rail's dispatcher if the URL contains admin or article:

RewriteRule ^(articles.*)$ dispatch.fcgi [QSA,L]
RewriteRule ^(accounts.*)$ dispatch.fcgi [QSA,L]
RewriteRule ^(admin.*)$ dispatch.fcgi [QSA,L]
RewriteRule ^(xml.*)$ dispatch.fcgi [QSA,L]
RewriteRule ^(live.*)$ dispatch.fcgi [QSA,L]

Responses to "DirectoryIndex + FastCGI in Typo"

Leave a response

My Card Add to your Address Book

Jesse Andrews
open source, web browsers, web services, web sites & folk dancing. contacts/sites

Keep Up To Date

Get updates via RSS or
get email when I blog

Previous Blog Posts