1. 程式人生 > >apache解析兩個域名訪問同一個專案的不同頁面

apache解析兩個域名訪問同一個專案的不同頁面

在你安裝後的Apache目錄下,有一個conf目錄,在這個目錄裡,有一個"httpd.conf"檔案.我們要做的,就是修改這個檔案.

在這個檔案裡,凡是以"#"開頭的每一行,都是無效的,如果你想讓你的設定起作用,就要把行首的"#"去掉.

找到
DirectoryIndex 這段.把它改成DirectoryIndex index.php index.Html index.html
這樣,你的網站目錄的預設首頁是 index.php, 如果沒有index.php系統會自動尋找index.html、html做為預設首頁了。

注意事項:index.php index.Html之間要有一個空格

另外你還可以操作一下其它的:

找到
ServerRoot 這段.將它設成你的Apache安裝目錄,我的是 ServerRoot "D:/Apache Group/Apache2"

找到 DocumentRoot 這段.把他設成你網站的根目錄,我的是 DocumentRoot "D:/Apache Group/web