# Disable routing?

**URL:** <https://www.ruby-forum.com/t/disable-routing/164757>\
**Category:** Rails\
**Created:** [April 5, 2009, 12:58pm UTC](https://www.ruby-forum.com/t/disable-routing/164757 "2009-04-05T12:58:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dacbo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b9e5f3/32.png) [@dacbo](https://www.ruby-forum.com/u/dacbo)\
**Post date:** [April 5, 2009, 12:58pm UTC](https://www.ruby-forum.com/t/disable-routing/164757/1 "2009-04-05T12:58:51Z")

</div>

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](http://mydomain.com/blog), I want the Rails app’s  
routing to ignore it.

Thanks,  
Chris

---

<div class="post-metadata">

**Author:** ![dacbo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b9e5f3/32.png) [@dacbo](https://www.ruby-forum.com/u/dacbo)\
**Post date:** [April 5, 2009, 1:08pm UTC](https://www.ruby-forum.com/t/disable-routing/164757/2 "2009-04-05T13:08:15Z")

</div>

On Apr 5, 8:03 am, Chris B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

---

<div class="post-metadata">

**Author:** ![dacbo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b9e5f3/32.png) [@dacbo](https://www.ruby-forum.com/u/dacbo)\
**Post date:** [April 5, 2009, 5:39pm UTC](https://www.ruby-forum.com/t/disable-routing/164757/3 "2009-04-05T17:39:59Z")

</div>

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 C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![dacbo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b9e5f3/32.png) [@dacbo](https://www.ruby-forum.com/u/dacbo)\
**Post date:** [April 5, 2009, 6:42pm UTC](https://www.ruby-forum.com/t/disable-routing/164757/4 "2009-04-05T18:42:45Z")

</div>

On Apr 5, 4:37 pm, Chris B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

---

<div class="post-metadata">

**Author:** ![dacbo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b9e5f3/32.png) [@dacbo](https://www.ruby-forum.com/u/dacbo)\
**Post date:** [April 8, 2009, 4:10am UTC](https://www.ruby-forum.com/t/disable-routing/164757/5 "2009-04-08T04:10:44Z")

</div>

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.
