【发布时间】:2019-03-22 23:20:10
【问题描述】:
我无法在域名前使用“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”,它将无法正常工作。
【问题讨论】:
标签: apache webserver wamp wampserver