具有域和子域的 Apache VirtualHost,两个不同的文件夹

Apache VirtualHost with domain and subdomain, two different folders

我想在我的域中放置两个站点,一个可以通过 "domain.com" 访问,另一个可以通过 "subdomain.domain.com" 有自己的文件夹 "/var/www/html/domain/""/var/www/html/subdomain/"

为了做到这一点,我以这种方式配置了虚拟主机

Listen 80
<VirtualHost *:80>
   ServerName remi-fongaufier.fr
   Alias /postfixadmin  "/var/www/html/postfixadmin/public/"
   DocumentRoot /var/www/html/remi-fongaufier/
   DirectoryIndex index.html
</VirtualHost>

<VirtualHost *:80>
   ServerName omnialib.remi-fongaufier.fr
   DocumentRoot /var/www/html/omnialib/
   DirectoryIndex index.php
</VirtualHost>

但似乎当我尝试访问子域时,他的服务器尝试在 "/var/www/html/domain/subdomain"

中搜索文件

有什么办法解决这个问题吗? 谢谢

你的 vhost.conf 没问题。

您检查数据库中的 ps_shop_url 了吗?