鍍金池/ 問答/PHP  Linux  數(shù)據(jù)庫/ .htaccess文件如何實(shí)現(xiàn)訪問指定目錄跳轉(zhuǎn)到404

.htaccess文件如何實(shí)現(xiàn)訪問指定目錄跳轉(zhuǎn)到404

apache服務(wù)器,需要讓客戶端訪問data目錄跳轉(zhuǎn)到404,比如Nginx的規(guī)則是:
location ^~ /data/ {
return 404;
}
apache的規(guī)則如何寫?

回答
編輯回答
鹿惑

在.htaccess里寫上"ErrorDocument 404 error/404.html" 后面是404路徑,不需要雙引號,保存后重啟apache即可,希望能幫助到你

2018年1月30日 19:03