Forum: Ruby on Rails Disable routing?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C8c8c5a0f4403ab778c5bce9511a81f1?d=identicon&s=25 Chris Benson (chrisbenson)
on 2009-04-05 12:58
(Received via mailing list)
I have a Rails application that a couple of folders in the root (of
public) for Wordpress and Mediawiki that I want to completely exclude
from Rails routing.  How do I have the routing function of my Rails
app ignore anything in the /blog or /wiki directories?

Example:

When someone types in http://mydomain.com/blog, I want the Rails app's
routing to ignore it.

Thanks,
Chris
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-04-05 13:08
(Received via mailing list)
On Apr 5, 8:03 am, Chris Benson <ch...@chrisbenson.com> wrote:
> I have a Rails application that a couple of folders in the root (of
> public) for Wordpress and Mediawiki that I want to completely exclude
> from Rails routing.  How do I have the routing function of my Rails
> app ignore anything in the /blog or /wiki directories?
>
> Example:
>
> When someone types inhttp://mydomain.com/blog, I want the Rails app's
> routing to ignore it.
>
Typically you don't do this inside rails, you do this in apache, nginx
etc. by telling it to only proxy through to rails what you want to
through (so normally you would let nginx or apache handle static
files)

Fred
C8c8c5a0f4403ab778c5bce9511a81f1?d=identicon&s=25 Chris Benson (chrisbenson)
on 2009-04-05 17:39
(Received via mailing list)
Thanks Fred, but it's a shared hosting environment, and I don't have
access to anything outside my /home area.

I'm looking for a way to tell Rails routing, "Ignore these two
directories."


On Apr 5, 7:07 am, Frederick Cheung <frederick.che...@gmail.com>
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-04-05 18:42
(Received via mailing list)
On Apr 5, 4:37 pm, Chris Benson <ch...@chrisbenson.com> wrote:
> Thanks Fred, but it's a shared hosting environment, and I don't have
> access to anything outside my /home area.
>
That's not necessarily a problem. For example if you were using apache
the a .htaccess in the DocumentRoot of your website can do things like
that.

> I'm looking for a way to tell Rails routing, "Ignore these two
> directories."
>
I'm pretty sure that by the time Rails has got the request it's too
late - rails isn't going to load php to execute your wordpress app for
example.d?

Fred
054ea2f04b5592b91f8223796cc53979?d=identicon&s=25 Brendon Whateley (brendon)
on 2009-04-08 04:10
(Received via mailing list)
You don't have to worry.  Rails runs as the 404 handler, so only
handles files that do not exist in the normal web server html area.
So, if the php file exists, it should take precedence over rails.
Think of how the index.html file has to be removed from a new rails
app to get it started.

I'd set a catchall route so that Rails would notice missing files in
those applications.

Brendon.
This topic is locked and can not be replied to.