默認(rèn)首頁(yè)的配置: 第一種:直接修改apache服務(wù)器的配置文件./conf/httpd.conf中的DirectoryIndex,如:(項(xiàng)目web以index.php為首頁(yè))
<IfModule dir_module> 第二種:apache服務(wù)器的配置文件./conf/httpd.conf中DirectoryIndex默認(rèn)不變?yōu)閕ndex.html,此時(shí)需要當(dāng)前項(xiàng)目下增加一個(gè)index.html文件,文件的內(nèi)容如下編輯:(項(xiàng)目web以index.php為首頁(yè)) index.html文件的內(nèi)容如下: <meta http-equiv="refresh" content="0; url=index.php"> 以上兩種方式,在地址欄中輸入http://localhost/web就可以直接訪問到index.php的頁(yè)面。 默認(rèn)網(wǎng)站的配置:(項(xiàng)目以web為例) 第一種:直接修改apache服務(wù)器的配置文件./conf/httpd.conf中的DocumentRoot和Directory,如: DocumentRoot "/usr/local/apache/htdocs/web" <Directory "/usr/local/apache/htdocs/web"> 第二種:不修改apache服務(wù)器的默認(rèn)配置文件httpd.conf,而是,修改./htdocs/目錄下的index.html文件: index.html文件的內(nèi)容如下: <meta http-equiv="refresh" content="0; url=/web"> 以上兩種方式,在地址欄中輸入http://localhost就可以直接訪問到web項(xiàng)目的網(wǎng)站。 轉(zhuǎn)載請(qǐng)注明原文地址:http://www./apache/201404/9487.html |
|