Sub Directory to a different server

后端 未结 3 1227
不思量自难忘°
不思量自难忘° 2020-12-15 21:22

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.myclie

相关标签:
3条回答
  • 2020-12-15 21:36

    Could you use Amazon CloudFront because it can map different paths to differnt servers ?

    0 讨论(0)
  • 2020-12-15 21:44

    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.

    0 讨论(0)
  • There are two different mechanisms that you might be able to use to accomplish this. What you use will depend on the setup you have as well as what permissions you have on the server from the hosting company if this is not a dedicated server.

    The first option is to map to the second server using the file system, then use mod_alias to point the subdirectory to the mapped location. This requires that the two servers be networked together, for instance if you have one server dedicated to a specific server, but own and can safely network the servers at the file system level.

    Another option would be to set up Apache to act as a proxy. This does require some advanced programming to configure but the system can be set up so that requests to the specified subfolder would be passed on to the remote web server. This can be used when the remote server can't be networked at the file system level, but lets you simulate the workings of a remote subdomain.

    0 讨论(0)
提交回复
热议问题