6

We had a site developed using on ruby on rails. It had

  1. Website
  2. Web services for mobile app
  3. Admin panel to manage data.

We started using wordpress to manage site content. We have finished development, have to move to production now. This is the current virtual host code for wordpress to work under /wordpress URI.

<Location /wordpress>
     PassengerEnabled off
     <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /wordpress/
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /wordpress/index.php [L]
     </IfModule>
  </Location>

I want to make phusion passenger work for the /admin and /api URIs. And / to go to wordpress.

Can we change the document root based on the URI? or any other better solution?

MDMarra
  • 100,183
  • 32
  • 195
  • 326
Venu
  • 215
  • 1
  • 7

1 Answers1

0

If you have wordpress working in '/' as opposed to /wordpress/ and /admin and /api as passenger I guess you need to stop the wordpress RewriteRule from passing the request to wordpress itself, in which case you can use a negative lookahead. Something like:

# Rewrite everything not starting with /admin or /api to wordpress controller
RewriteRule ^/(?!admin|api) /wordpress/index.php [L]

I'm my description of your requirement is not correct then please expand on your description.

Unbeliever
  • 2,286
  • 1
  • 9
  • 17