Windows 7 vhosts无法使用wamp在windows 7上运行

Windows 7 vhosts无法使用wamp在windows 7上运行,windows-7,wamp,vhosts,virtual-hosts,Windows 7,Wamp,Vhosts,Virtual Hosts,在windows 7上设置vHost时遇到问题。我在跑步 我的主机文件包括: 127.0.0.1 local.tribune.com <VirtualHost *:80> DocumentRoot "c:/wamp/www/" ServerName localhost </VirtualHost> <VirtualHost *:80> DocumentRoot "c:/Users/Name/My Documents/the trib

在windows 7上设置vHost时遇到问题。我在跑步

我的主机文件包括:

127.0.0.1 local.tribune.com
<VirtualHost *:80>
    DocumentRoot "c:/wamp/www/"
    ServerName localhost
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "c:/Users/Name/My Documents/the tribune/website/local.tribune.com/"
    ServerName local.tribune.com
</VirtualHost>
我已经在httpd.conf中包含了httpd-vhosts.conf

我的httpd-vhosts.conf包括:

127.0.0.1 local.tribune.com
<VirtualHost *:80>
    DocumentRoot "c:/wamp/www/"
    ServerName localhost
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "c:/Users/Name/My Documents/the tribune/website/local.tribune.com/"
    ServerName local.tribune.com
</VirtualHost>

DocumentRoot“c:/wamp/www/”
服务器名本地主机
DocumentRoot“c:/Users/Name/My Documents/thetribune/website/local.tribune.com/”
ServerName local.tribune.com
奇怪的是,如果我从DocumentRoot中删除“My”,那么在浏览器中转到localhost可以工作,我可以看到phpmyadmin,但是我看不到目录的内容,因为路径不正确。但是,只要我把“我的”放在路径中,wamp图标就永远不会变为白色(它保持为黄色),而且我无法访问localhost或local.tribune.com

一旦我再次删除“我的”,localhost将再次工作


我在wampserver.com和其他网站上看到过多篇关于这个问题的帖子,但没有一篇得到回复或解决。解决的大多数问题都是一些基本问题,如未包含或已删除httpd-vhosts.conf、缺少字符等。

在目录路径中留一个空格从来都不是一个好主意。URL编码将其解释为:“%20%”。我建议将您的网站文件放在D:/websites/local.tribune.com上

您可以阅读有关URL编码的更多信息


希望这会有所帮助

在目录路径中留一个空间从来都不是一个好主意。URL编码将其解释为:“%20%”。我建议将您的网站文件放在D:/websites/local.tribune.com上

您可以阅读有关URL编码的更多信息


希望这有助于解决这个问题。以前很接近,但只是错过了

在windows 7中,路径不是:

c:/Users/Name/My Documents/the tribune/website/local.tribune.com
但实际上是:

c:/Users/Name/Documents/the tribune/website/local.tribune.com
要证明这一点,请单击windows资源管理器窗口中路径的末尾,完整路径将以纯文本显示

另外,就因为我在网上看到了一些分歧,根据我的经验:

  • 驱动器号不区分大小写
  • 斜线可以走任何一条路
  • 尾随斜杠无效
  • 路径名中可以有空格

    • 解决了这个问题。以前很接近,但只是错过了

      在windows 7中,路径不是:

      c:/Users/Name/My Documents/the tribune/website/local.tribune.com
      
      但实际上是:

      c:/Users/Name/Documents/the tribune/website/local.tribune.com
      
      要证明这一点,请单击windows资源管理器窗口中路径的末尾,完整路径将以纯文本显示

      另外,就因为我在网上看到了一些分歧,根据我的经验:

      • 驱动器号不区分大小写
      • 斜线可以走任何一条路
      • 尾随斜杠无效
      • 路径名中可以有空格

      正如我在最初的问题中所指出的,并在我自己的回答中确认的那样,目录路径中的空格没有问题,而不是我问题的原因。但是谢谢!正如我在最初的问题中指出的,并且在我自己的回答中确认的那样,目录路径中的空格是可以使用的,这不是我问题的原因。但是谢谢!