Blogger Information
Blog 10
fans 0
comment 0
visits 10349
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
apache添加虚拟目录
亘古匆匆的博客
Original
745 people have browsed it

1.首先在Apache目录下找到httpd.conf文件,编辑打开。

2.先把默认的路径注释,用 # 注释,默认路径为如下:DocumentRoot "E:/PHPSever/wamp/www/"   这是我的,因人而异,取决于你的安装目录,在前面加上"#",让它变成这样即可:#DocumentRoot "E:/PHPSever/wamp/www/"

3.添加虚拟目录:

找到:

<IfModule dir_module>
    DirectoryIndex index.php index.php3 index.html index.htm
</IfModule>

在这行代码的下面加上:

<IfModule dir_module>
 DirectoryIndex index.html index.htm index.php
 Alias /phpworkspace "F:/phpworkspace"
 <Directory f:/phpworkspace>
 order allow,deny
 Allow from all
 </Directory>
</IfModule>

里面的F:/phpworkspace和f:/phpworkspace是你要用的虚拟路径Alias后面的/phpworkspace原则上是自己随便给定,但建议与你的目录下的文件夹名称一致。

 

这样就把虚拟路径配好了,假设在phpworkspace下有HelloWorld.php文件,在浏览器中输入:http://localhost/phpworkspace/HelloWorld.php 就可以访问了。 


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!