Routing question

I am trying to add a WordPress blog to my rails app. I have installed
WP in rails/myapp/public/blog with the hope that the actual URL will
look like www.mydomain.com/blog. How do I tell rails to let WP handle
requests for everything within that blog directory or otherwise get this
to work?

Thanks in advance for the assistance.

Bryan

I am trying to add a WordPress blog to my rails app. I have installed
WP in rails/myapp/public/blog with the hope that the actual URL will
look like www.mydomain.com/blog. How do I tell rails to let WP handle
requests for everything within that blog directory or otherwise get this
to work?

Configure your web server to pass anything under /blog “around” rails
and
handle it via normal PHP methods.

Philip H. wrote:

I am trying to add a WordPress blog to my rails app. I have installed
WP in rails/myapp/public/blog with the hope that the actual URL will
look like www.mydomain.com/blog. How do I tell rails to let WP handle
requests for everything within that blog directory or otherwise get this
to work?

Configure your web server to pass anything under /blog “around” rails
and
handle it via normal PHP methods.

Philip,

Thanks for your help. Sorry to be such a novice but could you (or
anyone else) give me a little more info on how to do this in Apache.

Thanks again,
Bryan

Hi, I have a similar issue and have solved this by putting the following
line in my .htaccess file in my rails app directory:-

RewriteCond %{REQUEST_URI} ^/osc.*
RewriteRule .* - [L]

This tells rails to leave the /osc subdirectory alone.

However, I have discovered a problem with this that I would really like
to solve. The application in my subdirectory /osc is OSCommerce
shopping cart. This has an admin page which is restricted using a
.htaccess file and Basic Auth.

When I go to /osc/admin the request is left alone by rails due to the
Rewrite lines above. However, when the .htaccess kicks in and requests
my username and password using the 403 Authorize Rails grabs the 403
Authorize and I get a 404 not found. If I turn rails off my OScommerce
Admin page works ok so I am fairly sure that rails is grabbing the 403
request despite the Rewrite Rule.

So the above line might help you out but if anyone has an answer to how
I can solve this other issue I would love to hear from you.

Cheers,

G.

Thanks Graham, this worked. Note to anyone else reading this who might
not know to do so, it only works when it is above “RewriteRule: On”. At
least that’s how it was for me.

Thanks Philip and Graham for helping me get this worked out.

Bryan

Guest wrote:

Philip H. wrote:

I am trying to add a WordPress blog to my rails app. I have installed
WP in rails/myapp/public/blog with the hope that the actual URL will
look like www.mydomain.com/blog. How do I tell rails to let WP handle
requests for everything within that blog directory or otherwise get this
to work?

Configure your web server to pass anything under /blog “around” rails
and
handle it via normal PHP methods.

Philip,

Thanks for your help. Sorry to be such a novice but could you (or
anyone else) give me a little more info on how to do this in Apache.

Thanks again,
Bryan

Hi, I have a similar issue and have solved this by putting the following
line in my .htaccess file in my rails app directory:-

RewriteCond %{REQUEST_URI} ^/osc.*
RewriteRule .* - [L]

This tells rails to leave the /osc subdirectory alone.

However, I have discovered a problem with this that I would really like
to solve. The application in my subdirectory /osc is OSCommerce
shopping cart. This has an admin page which is restricted using a
.htaccess file and Basic Auth.

When I go to /osc/admin the request is left alone by rails due to the
Rewrite lines above. However, when the .htaccess kicks in and requests
my username and password using the 403 Authorize Rails grabs the 403
Authorize and I get a 404 not found. If I turn rails off my OScommerce
Admin page works ok so I am fairly sure that rails is grabbing the 403
request despite the Rewrite Rule.

So the above line might help you out but if anyone has an answer to how
I can solve this other issue I would love to hear from you.

Cheers,

G.