开发者

disable direct linking to my files from the user's browser

I'm using the following .htaccess configurations to disable hotlinking :

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)mywesbite.com/开发者_运维百科.*$ [NC]
RewriteRule \.(flv|mp4|pdf|xls|doc|mov|wmv|avi)$ http://www.mywebsite.com/images/logo.jpg [R,L]

And I've tested it and everything is working fine, and now I want to disable downloading the files when the user tries to add the direct link of one of the files to his browser's address bar. Only the users that are referred to the file from my website can download it. Is there any way I can get that done by adding some more .htaccess configurations?


RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mywebsite.com(/)?.*$     [NC]
RewriteRule .*\.(flv|mp4|pdf|xls|doc|mov|wmv|avi)$ http://www.mywebsite.com/images/logo.jpg [R,NC]

Alternative if that doesnt work

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mywebsite.com(/)?.*$     [NC]
RewriteRule .*\.(flv|mp4|pdf|xls|doc|mov|wmv|avi)$ http://www.mywebsite.com/images/logo.jpg [R,NC]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜