【问题标题】:WAMP Server directing me to internet locations when I click on the folders in www folder当我单击 www 文件夹中的文件夹时,WAMP 服务器将我定向到 Internet 位置
【发布时间】:2013-01-26 00:48:57
【问题描述】:
我在运行 Windows 8 Pro 的笔记本电脑上安装了 WAMP 服务器。
我在wamp 文件夹中的www 文件夹中创建了多个文件夹。我的问题是,每当我尝试从 Web 浏览器中的 localhost 页面访问文件夹时,我都会被带到该文件夹的 Internet 页面,即我有两个名为 family 和 prestashop 的文件夹。每当我点击它们时,我的浏览器中都会打开一个选项卡,将我定向到 http://family/ 而不是 http://localhost/family/
可能是什么问题?
【问题讨论】:
标签:
windows-8
localhost
wamp
wampserver
【解决方案1】:
没有看到您的httpd.conf(或httpd-vhosts.conf),很难说出您的问题出在哪里(或为什么会出现问题)。通常,要设置多个站点,您会将虚拟主机添加到您的httpd.conf 或httpd-vhosts.conf,这将告诉 WAMP 当人们尝试访问该文件夹时该怎么做。看起来像http://localhost/family 和http://family 的网址之间的区别可能是您设置了一个虚拟主机,它允许您在不通过'localhost' 的情况下访问该目录。
你的http-vhosts.confC:\wamp\bin\apache\Apache<version>\conf\extras\ 中有类似的东西吗?
<VirtualHost *:80>
DocumentRoot "C:\wamp/www/family/"
ServerName "family"
</VirtualHost>