apache上,如何設定某檔案只能內網讀取 - Linux

Table of Contents

請問apache網站系統,如何設定某檔案只能被內網讀取

如 content.html 這個檔只能被網站裡的 read_content.php 檔來讀取,
而一般使用者無法拜訪content.html

--

All Comments

Margaret avatarMargaret2016-07-08
不要放在使用者看的到的目錄啊
Edward Lewis avatarEdward Lewis2016-07-11
簡單的例子給你參考: httpd.conf
RewriteEngine on
RewriteRule content.html /not_allow.html [L]
Eden avatarEden2016-07-14
可以看一下 httpd.conf,一般會有個語法禁止 .ht 開頭
檔案無法使用的語法,主要用 <Files> ... </Files>
語法來達成,可以參考看看...
Hedwig avatarHedwig2016-07-17
用 htaccess 或者在檔案內加入判斷IP的語法
Olive avatarOlive2016-07-20
content.html放httpd以外的目錄,用php去開檔讀檔
Poppy avatarPoppy2016-07-24
樓上這個方式的確是更好方式
James avatarJames2016-07-24
nullspace的方法+1