Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sub Directory to a different server

Is it possible to for a domain e.g. www.myclient.com to have a sub directory hosted on a completly different (our) server?

They don't want to point subdomain.myclient.com to our servers so they want it as folder www.myclient/subdomain/

Thanks in advance.

like image 324
Lizard Avatar asked May 16 '11 15:05

Lizard


People also ask

Can a subdirectory point to a different server?

The only way to get a subfolder like /blog to go to another server is with a redirect, and Google doesn't like that as much. To do so, in your domain's zone file, create an A record with "blog" and point it at the IP of your Wordpress server.

What is directory and sub directory?

Files are organized by storing related files in the same directory. In a hierarchical file system (that is, one in which files and directories are organized in a manner that resembles a tree), a directory contained inside another directory is called a subdirectory.


1 Answers

As discussed in the comments, your only option is a Proxy. Everything else (Like mod_rewrite / Alias) will do a header redirect, and expose the target address to the user.

However, Apache's proxying doesn't seem to be that complicated. The most basic example is

ProxyPass /mirror/foo/ http://backend.example.com/

Note that a proxy will of course double your traffic, because every byte requested will have to be fetched from the remote machine.

like image 63
Pekka Avatar answered Nov 16 '22 00:11

Pekka