Redirecting to wordpress or drupal

9 views
Skip to first unread message

hm

unread,
Jul 13, 2008, 9:48:10 AM7/13/08
to Phusion Passenger Discussions
Hi,

How can we redirect certain URLs to a different application in
mod_rails? This is possible with mongrel. Here is how.
http://www.igvita.com/2007/07/04/integrating-wordpress-and-rails

-subbu

Yaroslav Markin

unread,
Jul 13, 2008, 2:18:40 PM7/13/08
to phusion-...@googlegroups.com
You can use mod_rewrite with Passenger; you need to double check that .htaccess in public/ folder of your rails application is not "harmful" (e.g. redirecting to dispatch.cgi), or simply delete public/.htaccess, and then enable 

RailsAllowModRewrite on

and you're safe to use mod_rewrite rules.
--
Yaroslav Markin

hm

unread,
Jul 14, 2008, 2:15:50 AM7/14/08
to Phusion Passenger Discussions
Thanks so much. It worked. So my conf file looks something like:
RailsAllowModRewrite on
RewriteRule ^/drupal/?(.*)$ %{DOCUMENT_ROOT}/drupal/$1 [NC,QSA,L]
RewriteRule ^/wp/?(.*)$ %{DOCUMENT_ROOT}/wordpress/$1 [NC,QSA,L]

Right now I have installed my wordpress and drupal in the public
folder of my rails application. Is there a way I can move them to the
root of my apache (/var/www/html) and point the RewriteRule to that
path? I am guessing I have to modify the DOCUMENT_ROOT path. But
specifying like %{DOCUMENT_ROOT}/../../wordpress/ didn't work. Any
idea how to specify the path correctly?

-subbu

On Jul 13, 11:18 pm, "Yaroslav Markin" <yaroslav.mar...@gmail.com>
wrote:
> You can use mod_rewrite with Passenger; you need to double check that
> .htaccess in public/ folder of your rails application is not "harmful" (e.g.
> redirecting to dispatch.cgi), or simply delete public/.htaccess, and then
> enable
> RailsAllowModRewrite on
>
> and you're safe to use mod_rewrite rules.
>
Reply all
Reply to author
Forward
0 new messages