想知道如何将子域公共html目录重定向到外部服务器pu库html目录?E.g
当用户访问此链接时: Sub.domain.com/abc
abc的内容将从另一个外部服务器html目录中显示。
操作系统-- ubuntu环境-- vps
Sub.domain.com/abc
我是否需要将两个服务器ip地址指向同一个子域?我需要在两个服务器中定义子域吗?
简而言之,我应该做的是:)
发布于 2017-01-13 06:51:28
一种方法是简单地使用.htaccess文件重定向,假设您使用的是apache:
RewriteEngine on
RewriteCond %{REQUEST_URI} ^sub.domain.com/abc [NC]
RewriteRule ^(.*)$ http://external.org/ [R=301,L]然而,要更彻底地回答这个问题,请提供更详细的信息,如OS、server等。
https://serverfault.com/questions/826024
复制相似问题