The requested URL /test.php was not found on this server.

来源:互联网 发布:淘宝店铺装模板 编辑:程序博客网 时间:2024/06/05 09:34


WampServer自定义网站根目录


D盘新建了Demo文件夹(设定的网站根目录),新建文本test.php,拓展名改为.php

输入以下内容,如果成功,则输出success。

<?php    echo "success";?>


浏览器中输入要访问的地址:localhost/test.php,出现以下结果:

Not Found

The requested URL /test.php was not found on this server.


Apache/2.4.23 (Win64) PHP/5.6.25 Server at localhost Port 80

需要配置一下apache里面的配置文件:

httpd.conf   和  httpd.vhosts.conf




打开后,搜索DocumentRoot更改路径

${INSTALL_DIR}/www/  和  c:/wamp64/www/  改为d:/Demo(设定的网站根目录)



重新启动所有服务,就能够访问了



同时,要更改安装包下面的wampmanager.iniwampmanager.tpl配置。



搜索Menu.left,

1、wampmanager.ini下把www 目录对应的filename改为自定义目录

2、wampmanager.tpl下把${w_wwwDirectory}对应的filename改为自定义目录



退出、重启服务器,www目录变成了Demo目录,不过是乱码

点开后就转到了D盘的Demo文件夹




阅读全文
0 0
原创粉丝点击