Jul 22 2009
Site5 Wordpress Phusion Passenger and Rails
I recently created a little toy rails app to see how easy it was to bring up rails with Site5’s Phusion Passenger. Following the instructions at first everything went as planned and my rails app was working flawlessly.
A few days later I was writing a 2nd rails app and noticed a Wordpress 404 error whenever I asked for a route other than the root URL. I tried my original rails app and it was broken also. I hadn’t touched a thing.
After a chat session with Site5 support (awesome response), it wasn’t resolved. Their level 1 support said it was my .htaccess file, and provided no other help (poor response).
After opening a ticket myself and providing them my .htaccess, environment.rb and symlink they again said it was my .htaccess file, but this time it was my public_html .htaccess file that was wrong. But still no other url or hint.
Turns out my public_html .htaccess file has some wordpress rewrite rules in it. I needed to exclude the rails subdirectories so that wordpress wouldn’t see them.
Here’s what I added to my public_html .htaccess
RewriteCond %{REQUEST_URI} !^/rails_app_name/