Apache上的动态托管,具有两个不同构造的URL


Dynamic hosting on Apache with two differently constructed URLs

我创建了一个使用URL作为目录名称的CMS - 如下所示:

VirtualDocumentRoot /var/www/html/%0

因此,www.somesite.com从以下位置供应: /var/www/html/www.somesite.com

这有效,但是,我还需要一个沙盒 URL,因为在创建站点时站点 URL 通常不可用。

所以,除了路由普通的 URL 之外,我还需要将这样的东西路由到目录:

www.myCMSThingy.com/somesite

其他CMS一定已经解决了这个问题,但我似乎找不到任何例子。

我的理解是,您在同一台 linux 服务器机器中同时运行两者

  • www.somesite.com - VirtualDocumentRoot at /var/www/html/www.somesite.com

  • www.mycmsthingy.com - VirtualDocumentRoot at /var/www/html/www.mycmsthingy.com

如果这是真的,你可以像这样符号链接你的VirtualDocumentRoot来得到你想要的东西:

cd /var/www/html
ln -s www.somesite.com  www.mycmsthingy.com/somesite

在浏览器中,http://www.mycmsthingy.com/somesite/将包含您的 www.somesite.com 内容