我已经在 Windows 7 上设置了 Apache,以便有一些虚拟主机用于本地开发目的。
该httpd-vhosts.conf
文件对于所有虚拟主机都具有以下格式:
<VirtualHost *:80>
ServerName example.dev
DocumentRoot "C:/Program Files (x86)/Apache2.2/htdocs/example.dev/" # <--removing the forwardslash here doesn't fix this
</VirtualHost>
Windowshosts
文件中的每个都有:
127.0.0.1 example.dev
现在,困扰我的是,每次我example.dev
在地址栏中输入时,它都会添加一个额外的尾部正斜杠,变成example.com/
. 我为我所有的虚拟主机都得到了这个。简单地访问localhost
不会添加尾部正斜杠。这不会发生:.
没什么大不了的,但它困扰着我,我找不到解决方案。 localhost/
有任何想法吗?