当前位置:首页 > PHP教程 > PHP高级教程

php 在windows下配置虚拟目录的方法介绍

先打开apache的conf目录下的httpd.conf文件,在末尾添加如下代码:
复制代码 代码如下:

<virtualhost *:80>
 servername www.mydemo.com
 documentroot "d:/mydemo"
<directory "d:/mydemo">
 options followsymlinks includesnoexec indexes
 directoryindex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml
 allowoverride options fileinfo
 order deny,allow
 allow from all
</directory>
</virtualhost>

再到c:->windows->system32->drivers->etc目录,打开hosts文件。
在末尾添加如下代码:
复制代码 代码如下:

127.0.0.1 www.mydemo.com

然后再创建d:mydemo目录
再然后重启一下apache服务器。
在浏览器输入www.mydemo.com看看


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!