php - How can I block requests for a file or directory unless it comes from a specified file? -


in .htaccess file have following rewriterules:

rewriterule ^content/(.*)\.(txt|md|mdown)$ error [r=301,l] rewriterule ^site/(.*) error [r=301,l] 

these work blocking direct access txt|md|mdown file types , entire site/ directory.

that said, i'm working on building out .appcache file cache site offline viewing , need able access these files , directories .appcache file. have .appcache file set , i'm getting following error in browser:

application cache error event: resource fetch failed (-1) http://website.com/site/panel/blueprints/home.php 

is possible update rewriterule allow access file?

rewritecond %{http_referer} !^$ rewritecond %{http_referer} !^http://(www\.)?yoursite.com.br/.*$ [nc] rewriterule .*\.(pdf|cdr|indd|psd|jpg|jpeg|ai|zip|rar|7z)$ - [f] 

just replace yoursite.com site , .*$ specific file need.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -