PDA

View Full Version : Rails context can't disable rewrite


fantasydreaming
02-11-2011, 10:54 AM
I wanted to keep the handy rails context, but handle the rewrites myself (because I wanted to add a check to skip the dispatch rewrite if the URI starts with /images due to lots of missing images on my server).

I'd then add my own rewrite rules to route to dispatch.lsapi in the virtual hosts rewrite section.

So I set the Rails context's "Enable rewrite" and "Rewrite Inherit" to No.

I disabled my virtual host rewrites to test. restarted, and it's still doing the rails rewrites for me.

It'd be nice if disabling this worked, so we could customize it ourselves without having to resort to a custom external app/script handler (which I've never been able to figure out)

Thanks!

fantasydreaming
02-11-2011, 11:46 AM
After looking at the wiki, is the "magic" rails context arranged so it works with the 404 handler? This would explain my problems with rewrite rules...

http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:ruby_rails

mistwang
02-11-2011, 12:28 PM
"Rails" context uses rails dispatcher as custom 404 handler, do not use rewrite rules.
Just use rewrite to redirect missing files to an existing file should work.