I think what I’m asking is impossible but here goes.
I have two sites, one is wordpress hosted on an apache server. Let’s call this one mydomain.com
The other is on IIS and let’s call that one blog.mydomain.com
Is it possible to somehow have a subdirectory e.g. mydomain.com/blog point at blog.mydomain.com ?
As the two sites are built on different platforms I’m currently having to keep them on separate domains but ideally I’d like them to behave like this – wordpress as my main site and the subfolder is my .Net site.
I know if it was all .Net and IIS it would be possible to have a virtual directory point at a different app but this isn’t a realistic possibility for me.
I think this is going to be impossible to achieve but any advice or recommendations would be most welcome.
Thanks
A reverse proxy should solve your problem by fetching the data from the other server transparently:
http://en.wikipedia.org/wiki/Reverse_proxy
Nginx is a popular choice for Linux platforms and I just noticed available for Windows platforms as well:
http://wiki.nginx.org/Main
Apache has a
ProxyPass
directive which will allow you to do this.Define it in your
VirtualHost
configuration ofmydomain.com
as follows:You will also need to enable
mod_proxy
for Apache (and possibly other modules) as listed in the Apache documentation here.I will still say that what you are trying to do is not the ideal way to access the site. Besides the point that there will be a performance overhead due to the proxy operations, some site configurations are such that they are tied to a single domain and folder path. In such cases either the site will work with quirks (dangerous) or not work for the user at all (less dangerous). When I say dangerous I mean the user might be tricked into thinking that the site is working and perform an irreversible site operation which may be stuck in limbo or cause data corruption.