本地子域重新路由到XAMPP默认页面

时间:2015-07-16 19:09:21

标签: apache google-chrome dns xampp

我遇到了XAMPP和Chrome的一个奇怪问题。多年来我在localhost上创建了几个子域名(foo.localhost,bar.localhost等)到目前为止,这些子域在所有浏览器上都运行良好。我的HOST文件已正确配置,没有最近的更改。

我以这种方式添加了这些子域名:

<VirtualHost *>
    DocumentRoot "path/to/xampp/htdocs/foo"
    ServerName foo.localhost
</VirtualHost>

在主持人中我说:

127.0.0.1 foo.localhost 

确切的行为是这样的。在Firefox上我输入http://foo.localhost/bar/bat,我在XAMPP上从Apache获得了预期的资源。我在Chrome上输入完全相同的地址,然后重定向到http://foo.localhost/xampp/

这里的独特之处在于Firefox可以正常运行,Chrome则不然。

服务器访问日志没有显示任何奇怪的内容。

我无法弄清楚这一点。以下是我的系统详细信息:

  • Windows 7(64位)
  • Firefox 38.0.5
  • Chrome 43.0.2357.130 m

如果有任何想法请随时分享:)

1 个答案:

答案 0 :(得分:0)

我明白了。我在主机文件中添加了IPv6等价物,所有这些都在今后工作。没有<?php $sourcePath = 'custom.csv'; $tempPath = $sourcePath . 'temp'; $source = fopen($sourcePath, 'r'); $target = fopen($tempPath, 'w'); if($source){ while(!feof($source)) { $line = str_replace("Village\\", "Village",fgets($source)); fwrite($target, $line); } } else { echo "$sourcePath not found, or using the wrong permissions."; } fclose($source); fclose($target); unlink($sourcePath); rename($tempPath, $sourcePath); ?>

这样的地方
相关问题