Disable hot linking or direct download of my videos and only stream the video when it's displayed from a page in my website

こ雲淡風輕ζ 提交于 2019-12-01 02:17:22

To disable hot-linking and replace the content with a generic site logo fo sorts to direct people back to your site rather then the image, add this to the .htaccess folde rin the root of your site:

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yoursite\.com/ [NC]
RewriteCond %{REQUEST_URI} !hotlink\.(gif|png\SOME FILETYPES NOT TO HOTLINK) [NC]
RewriteCond %{REQUEST_URI} !^/index.php?main_page=videos_page&
RewriteRule .*\.(gif|jpg|png)$ http://www.mywebsite.org/generic/imagetoreplace.png [NC] 

Remember, .htaccess is hidden, so make sure 'show hidden files' it turned on in yoru ftp client.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!