默认首页的配置: 第一种:直接修改apache服务器的配置文件./conf/httpd.conf中的DirectoryIndex,如:(项目web以index.php为首页)
<IfModule dir_module> 第二种:apache服务器的配置文件./conf/httpd.conf中DirectoryIndex默认不变为index.html,此时需要当前项目下增加一个index.html文件,文件的内容如下编辑:(项目web以index.php为首页) index.html文件的内容如下: <meta http-equiv="refresh" content="0; url=index.php"> 以上两种方式,在地址栏中输入http://localhost/web就可以直接访问到index.php的页面。 默认网站的配置:(项目以web为例) 第一种:直接修改apache服务器的配置文件./conf/httpd.conf中的DocumentRoot和Directory,如: DocumentRoot "/usr/local/apache/htdocs/web" <Directory "/usr/local/apache/htdocs/web"> 第二种:不修改apache服务器的默认配置文件httpd.conf,而是,修改./htdocs/目录下的index.html文件: index.html文件的内容如下: <meta http-equiv="refresh" content="0; url=/web"> 以上两种方式,在地址栏中输入http://localhost就可以直接访问到web项目的网站。 转载请注明原文地址:http://www./apache/201404/9487.html |
|