首页 > 解决方案 > WAMP 服务器不允许使用“www”访问网站

问题描述

我无法在域名前使用“www”访问我的网站,但如果我不使用“www”,我可以。我希望两者都可以访问。

我非常熟悉在 Linux 上使用 Apache2 Server,但我不必经常将它与 WAMP 一起使用。我在配置文件中做了很多乱七八糟的事情,并尝试了几种不同的方法,但似乎没有任何效果。

这是 httpd-vhosts.conf 文件:

# Virtual Hosts

<VirtualHost *:80>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    Require all granted
  </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName wherehousemke.com
    DocumentRoot "c:/wamp64/www/wherehousemke"
    <Directory  "c:/wamp64/www/wherehousemke/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        Require all granted
    </Directory>
</VirtualHost>

我试图让它工作的网站是http://wherehousemke.com。该 URL 有效,但如果您在其中添加“www”,它将无法正常工作。

标签: apachewebserverwampwampserver

解决方案



推荐阅读