rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org
2007-Apr-18 19:11 UTC
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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> 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. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org
2007-Apr-19 01:50 UTC
Re: Routing question
Philip Hallstrom 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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Guest wrote:> Philip Hallstrom 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, > BryanHi, 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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> > 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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---