你好,我有一个js代码,我想在其中隐藏实际的url,并在我的域中显示md5哈希,如果有人尝试复制源代码,他将获得无效的目的地,因此脚本只能在我的域上运行
这是我的JS代码
<script>
jwplayer("container").setup({
width:640,
height:360,
stretching:"exactfit",
primary: "HLS",
autostart:true,
image: "http://url-of-image",
file: "http://url-of-file"
});
</script>
所以我想隐藏图像网址和文件网址
您无法隐藏 URL,因为它在最后阶段对最终用户可见。您最好在您的页面上设置一个cookie,并在发送视频或任何文件时检查cookie是否存在。在这里你可以找到一个例子:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_COOKIE} !example-cookie=true
RewriteRule .* /err/401.php