# Can Rails and PHP work together?

**URL:** <https://www.ruby-forum.com/t/can-rails-and-php-work-together/129620>\
**Category:** Rails\
**Created:** [February 20, 2008, 4:33am UTC](https://www.ruby-forum.com/t/can-rails-and-php-work-together/129620 "2008-02-20T04:33:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wemagor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/8edcca/32.png) [@wemagor](https://www.ruby-forum.com/u/wemagor)\
**Post date:** [February 20, 2008, 4:33am UTC](https://www.ruby-forum.com/t/can-rails-and-php-work-together/129620/1 "2008-02-20T04:33:30Z")

</div>

Hello everyone,

I am new to RoR, coming from an [ASP.NET](http://ASP.NET) background. I’m currently  
working  
on a politically-themed social network, and I want to have multiple  
bloggers  
who will blog about various topics. My web host offers several  
PHP-based  
blogging engines, and I like WordPress, so I am trying to set it up with  
a  
subdomain such as [blogs.mydomain.com/blog\_name](http://blogs.mydomain.com/blog_name). However, I’m getting  
Rails  
errors because the URL uses the same conventions as Rails, and it’s  
trying  
to interpret it as a Rails application, so it’s not finding a controller  
or  
view.

Is there any way that I can tell Rails NOT to try and parse these URLs?  
I  
mean, I could easily just tack on index.php to the URL, and it seems to  
work  
properly, but I’m sure I won’t always remember it, and I doubt the  
bloggers  
will, either (I want to give them some degree of autonomy with their  
blogs).

Can anyone provide suggestions?

Regards,

Wayne M.  
Co-founder, [LibertyTruth.org](http://LibertyTruth.org)

---

<div class="post-metadata">

**Author:** ![wemagor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/8edcca/32.png) [@wemagor](https://www.ruby-forum.com/u/wemagor)\
**Post date:** [February 20, 2008, 4:41am UTC](https://www.ruby-forum.com/t/can-rails-and-php-work-together/129620/2 "2008-02-20T04:41:46Z")

</div>

On Feb 19, 2008, at 7:33 PM, Wayne M. wrote:

> Is there any way that I can tell Rails NOT to try and parse these  
> URLs? I mean, I could easily just tack on index.php to the URL, and  
> it seems to work properly, but I’m sure I won’t always remember it,  
> and I doubt the bloggers will, either (I want to give them some  
> degree of autonomy with their blogs).
> 
> Can anyone provide suggestions?
> 
> Regards,

Personally, I’d create an Apache virtual host for [blogs.mydomain.com](http://blogs.mydomain.com)  
and set the DocumentRoot to wherever you need your PHP app to live.

---

<div class="post-metadata">

**Author:** ![wemagor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/8edcca/32.png) [@wemagor](https://www.ruby-forum.com/u/wemagor)\
**Post date:** [February 20, 2008, 5:05am UTC](https://www.ruby-forum.com/t/can-rails-and-php-work-together/129620/3 "2008-02-20T05:05:11Z")

</div>

On Feb 19, 7:41 pm, “s.ross” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > I am trying to set it up with a subdomain such as [blogs.mydomain.com/](http://blogs.mydomain.com/)  
> > Can anyone provide suggestions?
> 
> > Regards,
> 
> Personally, I’d create an Apache virtual host for [blogs.mydomain.com](http://blogs.mydomain.com)  
> and set the DocumentRoot to wherever you need your PHP app to live.

did you see this  
[http://www.igvita.com/2007/07/04/integrating-wordpress-and-rails/](http://www.igvita.com/2007/07/04/integrating-wordpress-and-rails/)

---

<div class="post-metadata">

**Author:** ![wemagor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/8edcca/32.png) [@wemagor](https://www.ruby-forum.com/u/wemagor)\
**Post date:** [February 20, 2008, 5:39am UTC](https://www.ruby-forum.com/t/can-rails-and-php-work-together/129620/4 "2008-02-20T05:39:09Z")

</div>

Wayne M. wrote:

> [blogs.mydomain.com/blog\_name](http://blogs.mydomain.com/blog_name) [http://blogs.mydomain.com/blog\_name](http://blogs.mydomain.com/blog_name).

> Is there any way that I can tell Rails NOT to try and parse these URLs?

No. You must tell mommy to separate these children’s toys. Configure  
your web  
server itself (Apache or whatever) to route certain paths to PhP and  
others to  
Rails.

–  
Phlip
