Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(): Failed opening '/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php' for inclusion (include_path='.:/opt/cpanel/ea-php70/root/usr/share/pear') in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24
如何修改網站 index 的優先讀取順序? – unethost無限空間虛擬主機 技術分享部落格

如何修改網站 index 的優先讀取順序?

apache_htaccess_index._wp

在一般虛擬主機,因為root權限問題,
無法直接去修改 apache 的 httpd.conf,

有一種改法是修改 /public_html 底下的 .htaccess 檔案,
這樣 web server 的部份設定,其優先權會以 .htaccess 為主。

在我們的知識庫裡,有.htaccess的部份教學

今天希望將訪客進站的優先讀取檔,
由 index.php 改為 default.php,
如果去修改 httpd.conf,這樣整部主機的網站可能因此被迫改動,
所以照著我們前一段的說明,改為修改 .htaccess 檔。
<如何設定語法>

1.其編輯語法為:

#Alternate default index page
DirectoryIndex default.php

2.如果是要設定多種排序
比方說讀不到 index.html 就改讀取 index.php

語法就是:

#Alternate default index page
DirectoryIndex index.html index.php
<友善的檔案下載>

點擊下載: .htaccess

這是第二範例,請在在修改成您要的內容,在上傳即可。

(內容為 .htaccess.zip ,因為這wp不允許直接上傳 .htaccess)

 

<進階用法>
如果將 .htaccess 傳到不同資料夾,
就可以控制不同資料夾的 index  讀取。

 

(本篇教學由unethost.com客服撰寫)

延伸閱讀:如何備份Cpanel後台安裝的套裝程式?

安裝上述的軟體,我們提供虛擬主機試用,七天滿意保證,
功能完整使用不受限制,歡迎點我申請。