wampserver的localhost下点击项目,url不对
找到wamp 的www 目录下的index.php 文件打开后 找到这里
$handle=opendir(".");
$projectContents = '';
while (($file = readdir($handle))!==false)
{
if (is_dir($file) && !in_array($file,$projectsListIgnore))
{
$projectContents .= '<li><a href="';
if($suppress_localhost)
$projectContents .= 'http://'.$file.$UrlPort.'/"';
else
$projectContents .= 'http://localhost'.$UrlPort.'/'.$file.'/"';
$projectContents .= '>'.$file.'</a></li>';
}
}
将这一行:
$projectContents .= 'http://'.$file.$UrlPort.'/"';
修改为:
$projectContents .= 'http://localhost/'.$file.$UrlPort.'/"';
解决WAMPserver中localhost点击项目时URL错误问题,通过修改www目录下index.php文件中的链接生成方式,确保正确指向本地主机。

1034

被折叠的 条评论
为什么被折叠?



