Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a single Domain that I would like to share across two web applications. One Wordpress, the other Rails hosted on two separate servers. Specifically, I would like a handful of url resources processed by one server and not the other.

For example:

http://example.com/ -Wordpress
http://example.com/about -Wordpress
http://example.com/some-other-random-page -Wordpress
http://example.com/signup -Rails

Can this be done with a rewrite rule? Or would I need to set up a proxy server in front of both web applications?

share|improve this question

3 Answers 3

URL rewriting will not be enough in this case. You need to run a proxy in font of these two servers. This proxy can then (based on URL) forward each request to the appropriate server.

share|improve this answer

You can either set up a proxy server in front of both, or have one (say, for instance, the Wordpress server) proxy over to the other for the locations that it should handle.

For example:

<Location /signup>
    ProxyPass http://rails-server-name-or-ip/signup
    ProxyPassReverse http://rails-server-name-or-ip/signup
</Location>
share|improve this answer
    
This seems like the appropriate answer. I will talk with my hosting provider to see if I can make the changes. Thanks –  Karl Jan 22 '12 at 12:31

Just a thought, but your could point example.com to a generic isapi rewrite site, and then have the isapi change not only the URL, but also the port. This would be one way of getting around the need of a proxy. Then you just setup a port forward/NAT so that 80 goes to one server and 81 goes to another.

http://example.com/ -Wordpress http://example.com/about -Wordpress http://example.com/some-other-random-page -Wordpress http://example.com:81/signup -Rails

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.