How to prevent a file from direct URL Access?

后端 未结 7 2031
后悔当初
后悔当初 2020-11-22 05:26

I\'m using Apache and I have a sample web folder on my Local Host, like:

      http://localhost/test/

Files in th

7条回答
  •  名媛妹妹
    2020-11-22 06:10

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?localhost.*$ [NC] 
    RewriteCond %{REQUEST_URI} !^http://(www\.)?localhost/(.*)\.(gif|jpg|png|jpeg|mp4)$ [NC] 
    RewriteRule . - [F]
    

提交回复
热议问题