# Rails and PHP app under the same domain

**URL:** <https://www.ruby-forum.com/t/rails-and-php-app-under-the-same-domain/186224>\
**Category:** Rails\
**Created:** [April 2, 2010, 2:01pm UTC](https://www.ruby-forum.com/t/rails-and-php-app-under-the-same-domain/186224 "2010-04-02T14:01:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johndel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/65b543/32.png) [@johndel](https://www.ruby-forum.com/u/johndel)\
**Post date:** [April 2, 2010, 2:01pm UTC](https://www.ruby-forum.com/t/rails-and-php-app-under-the-same-domain/186224/1 "2010-04-02T14:01:22Z")

</div>

Hello

I have a rails site in a domain like [http://domain.com/](http://domain.com/) which is in  
one folder the whole application and a blog (wordpress - php  
application in another folder) under [http://blog.domain.com/](http://blog.domain.com/).

How can I do [Domain Blog | Domain, Website, and Ecommerce Tips for Small Businesses](http://domain.com/blog/) shows up the php application?

Thank you!

---

<div class="post-metadata">

**Author:** ![johndel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/65b543/32.png) [@johndel](https://www.ruby-forum.com/u/johndel)\
**Post date:** [April 2, 2010, 3:24pm UTC](https://www.ruby-forum.com/t/rails-and-php-app-under-the-same-domain/186224/2 "2010-04-02T15:24:29Z")

</div>

On Fri, Apr 2, 2010 at 7:59 AM, Yiannis [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello
> 
> I have a rails site in a domain like [http://domain.com/](http://domain.com/) which is in  
> one folder the whole application and a blog (wordpress - php  
> application in another folder) under [http://blog.domain.com/](http://blog.domain.com/).
> 
> How can I do [Domain Blog | Domain, Website, and Ecommerce Tips for Small Businesses](http://domain.com/blog/) shows up the php application?

You could have rails redirect from [Domain Blog | Domain, Website, and Ecommerce Tips for Small Businesses](http://domain.com/blog) to [blog.domain.com](http://blog.domain.com)

But it might be better to do this at the http server layer. For  
example if you are using apache as the front end, you could use  
mod\_rewrite to route blog urls the the blog before the rails app ever  
sees them.

–  
Rick DeNatale

Blog: [http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)  
Github: [rubyredrick (Rick DeNatale) · GitHub](http://github.com/rubyredrick)  
Twitter: @RickDeNatale  
WWR: [http://www.workingwithrails.com/person/9021-rick-denatale](http://www.workingwithrails.com/person/9021-rick-denatale)  
LinkedIn: [http://www.linkedin.com/in/rickdenatale](http://www.linkedin.com/in/rickdenatale)

---

<div class="post-metadata">

**Author:** ![johndel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/65b543/32.png) [@johndel](https://www.ruby-forum.com/u/johndel)\
**Post date:** [April 2, 2010, 10:53pm UTC](https://www.ruby-forum.com/t/rails-and-php-app-under-the-same-domain/186224/3 "2010-04-02T22:53:32Z")

</div>

Hi!

Depending on how much power you have over your server, I would  
recommend “pound” for that.

But it does a little more than only what you want. And it requires  
that you change your complete virtual server configuration.

> **[apsis.ch](http://www.apsis.ch/pound/)**
>
> This domain may be for sale!

Regards,

Marian
