【问题标题】:URL wont direct correctlyURL 无法正确定向
【发布时间】:2014-11-01 06:32:21
【问题描述】:

我的虚拟主机名有问题。我正在基于 CentOS 的操作系统中设置一个虚拟主机。在主机文件中,我添加了 2 个虚拟主机 URL。我还编辑了 httpd.conf 文件。我添加了虚拟主机目录。我重新启动了 httpd 并在浏览器中打开了 URL。但它不会进入我的页面。它重定向到其他页面。询问主机名。这是我的设置。

在我的 httpd.conf 我有这个:

<VirtualHost *:80>
    DocumentRoot /data/APACHE/html/metro
    ServerName store6.giftregistry.com.ph
    ServerAlias store6.giftregistry.com.ph
    <Directory "/data/APACHE/html/metro">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /data/APACHE/html/metro
    ServerName store7.giftregistry.com.ph
    ServerAlias store7.giftregistry.com.ph
    <Directory "/data/APACHE/html/metro">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

在主机文件中我有这个:

10.128.0.63       store6.giftregistry.com.ph
10.128.0.63       store7.giftregistry.com.ph

我的代码有错误吗?

【问题讨论】:

    标签: apache centos vhosts


    【解决方案1】:

    添加

    NameVirtualHost *:80

    在上面..

    文档: http://httpd.apache.org/docs/2.2/vhosts/name-based.html

    【讨论】:

      猜你喜欢
      • 2023-03-16
      • 2020-01-15
      • 2021-10-13
      • 2017-06-22
      • 2018-10-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-23
      相关资源
      最近更新 更多