wampserver 打开网站,不显示localhost的解决方法


安装wampserver之后,打开网站,URL前面不显示localhost

解决方法:搜索while (($file = readdir($handle))!==false)  这段代码,删掉下面{}的。

用这段代码

{{ if (is_dir($file) && !in_array($file,$projectsListIgnore))  { //[modif oto] Ajout éventuel de http:// pour éviter le niveau localhost dans les url $projectContents .= ‘<li><a href=”‘; if($suppress_localhost) $projectContents .= ”.$file.$UrlPort.’/”‘; else $projectContents .= ‘http://localhost’.$UrlPort.’/’.$file.’/”‘; $projectContents .=’>’.$file.'</a></li>’; }}

替换原代码。

wampserver localhost无法显示解决方法,用上图红框里的内容(也就是上面引用的代码)替换原代码即可。