apache配置虚拟目录

来源:互联网 发布:意大利古典家具 知乎 编辑:程序博客网 时间:2024/06/07 11:43

apache配置虚拟目录

在项目下文件里面访问 D:/test目录下的文件。
apache安装目录:
C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\mypro,
mypro/test.html文件:
在这个html里面要引用D:/test/1.jpg

<html><body>
<h1>my pro!</h1>
<img src="/test/1.jpg"></img>
<img src="http://localhost/test/1.jpg"></img>
</body></html>

浏览器中:http://localhost/mypro/test.html 再加入如下配置后可以访问图片:

在httpd.conf中添加如下代码:

<IfModule dir_module>    #相当于欢迎页面    DirectoryIndex index.html test.html    #站点别名     Alias /test "D:/test"    #访问权限设置     <Directory "D:/test">       Order allow,deny        Allow from all    </Directory></IfModule>


 

 

 

0 0
原创粉丝点击