I understand you are able to redirect subdomains to another server, but could you need to do exactly the same with folders?

Say I've example.com. I'm able to redirect mysubdomain.example.com to another server, but could I redirect example.com/mysubdomain to another server? Let me host a rails application for the reason that folder on the site that runs php while still maintaining good search engines like google rankings (by not developing a sub domain which in my opinion in acknowledged as another site).

Any help?


As brock Batsell recommended, an answer could be proxying the demands. you'll usually find this behavior in web applications which use lengthy polling services, like chats, and want to proxy out individuals services to some second web server to lessen the burden around the primary one (usually, apache + lighhtpd)

This is actually the fundamental usage (presuming youre using apache, and also the other web-server is listening around the 81 port):

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_connect_module modules/mod_proxy_connect.so

LoadModule proxy_http_module modules/mod_proxy_http.so

LoadModule proxy_ftp_module modules/mod_proxy_ftp.so

ProxyRequests Off

ProxyPreserveHost On

proxypass /folder-to-proxy http://localhost:81/folder

proxypassReverse /folder-to-proxy http://localhost:81/folder

<Proxy http://localhost:81/>

    Order Allow,Deny

    Allow all


Just replace the localhost and port number together with your second server host and port.

Please be aware that even when its not necessary to proxy the ftp traffic, in apache the proxy_ftp_module should be enabled too.

You are able to only do that using a proxy, which could forward all demands towards the /mysubdomain folder to particular IP and port, obtain the response, then return the reaction to the consumer transparently.

Virtually any mainstream web server may have a module to get this done for those who have treatments for its configuration file. (Apache has mod_proxy, nginx has HTTP Proxy, lighttpd features its own mod_proxy.)