views:

1407

answers:

5

LEt's say I want to have a subfolder called- http://www.foo.com/news/ but I actually want that news folder on a different server. I realize it can be done easily with subdomains, but I was really hoping for the subfolder thing.

Is it possible? How?

+1  A: 

Yes, there is a setting in IIS which lets you point a subfolder to a different site. So make the sub folder a virtual directory on your site, and then in the properties of the virtual directory choose the option for 'A redirection to a URL'... in it specify your other site.

Of course, this is assuming your are using IIS. There should be something similar available to use in whatever web server you are using.

Vaibhav
I am using IIS so this is probably the route I'd want to go. Thanks! I suppose it won't matter that the remote site is on a Linux server...
A: 

DNS resolution happens at the domain level. DNS doesn't have any knowledge of URLs or folders so your name will always point to the same server. You can make that server actually retrieve the information from another one or redirect to another one but that's not very satisfactory I'd say.

J. Pablo Fernández
+1  A: 

It can't be done with DNS because the domain name is only the *.example.com of the address.

It can be done by configuring a proxy on your www machine to pass all requests for /news to another server. It's very easy to do with apache but I don't remember all the details at this moment.

David Locke
+4  A: 

The only real way to it is with a reverse proxy ( Or a webserver acting as a reverse proxy ) between you and the outside world that knows what IP address each folder is in.

Its not possible to just make something, for example have google.com appear at http://foobar.com/google/ because the browser won't route to the IP address ( lack of information ).

You can fake that effect with a fullpage IFrame or Other frameset system, but that's rather dodgy.

If you are using apache, you can set this up with mod_proxy. More details can be found here:

Kent Fredric
+1  A: 

For Apache the following entries in httpd.conf are needed:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

ProxyPass /news http://newsserver.domain.com/news
ProxyPassreverse / http://newsserver.domain.com/

Frans