Can a website subdirectory be served by a different web server?
Asked Answered
M

4

8

Suppose I have a website hosted at the url:

http://www.mysite.com/

Say this is hosted by hosting provider "A".

Now, I want to host a subdirectory within this site at another host:

http://www.mysite.com/blog/

...say I host this with hosting provider "B". So all the pages under this site would be at a completely different data center.

Is this configuration possible?

Move answered 4/12, 2009 at 17:56 Comment(0)
J
7

If you can configure a reverse proxy... then yes.

Apache mod_proxy

IIS reverse proxy <= is is a codeproject solution and may not have support. You can probably find many more if you just search for reverse proxy.

If you are using IIS7 (Vista, Windows 7, Server 2008) you may use the HTTP Redirect feature that is built in.

Jonejonell answered 4/12, 2009 at 17:58 Comment(0)
R
1

Yes, entirely possible.

Recently I came across this exact problem, using IIS. For our solution we used ISAPI_Rewrite 3.

You can use a simple directive in IIS with ISAPI_Rewrite 3 and the RewriteProxy directive

If you are using Apache mod proxy will work, (mentioned already here). Unfortunately there's no equivalent of RewriteProxy in Apache mod rewrite.

One caveat of this solution we had was to make some rewrite rules to handle the new url's to blog posts.

Roundly answered 4/12, 2009 at 19:8 Comment(1)
True, but there is ProxyPass in mod_proxy: httpd.apache.org/docs/2.0/mod/mod_proxy.html#proxypassSeizing
A
1

You'll need a sqiud server in front of both apaches for optimal results. All the requests will come to the squid instance, which will route it to the right apache based on request path.

Both apaches will have to be configured for that domain. DNS A record must point to the Squid instance.

Aristotle answered 16/12, 2009 at 23:10 Comment(0)
F
0

I beleive following is the best way to handle the situation:

(a) Create a sub-domain mapping withthe sub-directories. (b) Map this sub-domain with a new IP (New hosting server)

Isn't it clean and simple?

Flimsy answered 1/8, 2013 at 10:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.