hotlinking

Apache .htaccess hotlinking redirect

家住魔仙堡 提交于 2020-01-21 05:40:06
问题 I am trying to create a redirection when someone hotlinks images in one directory on my site. If someone hotlinks an image, I want to redirect them to a corresponding image (same file name) in a different directory. If someone hotlinks: www.mydomaoin.com/PlayImages/Basic/Embedded/{ImageName.gif} I want it to redirect to: www.mydomaoin.com/PlayImages/Basic/Shared/{ImageName.gif} Thoughts? 回答1: RewriteEngine on #redirect image hotlinks RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER}

Dynamically prevent hotlinking images using htaccess for multiple domains

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 11:58:50
问题 Preventing hotlinking using htaccess is well documented. However, I want to prevent hotlinking for multiple domains without adding a rule per domain. My idea is to match the referrer with the hostname, this seems like a good solution to me. <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?%{HTTP_HOST}/.*$ [NC] RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L] </IfModule> Is this is a proper and safe solution to prevent

hotlink protection

半城伤御伤魂 提交于 2019-12-20 04:59:36
问题 i made this simple code to prevent hotlinking my files from my php download file : if ((strpos($_SERVER['HTTP_REFERER'],'www.domain.com')!==0)) { $redirect='index.php'; header("Location: $redirect"); exit; } it's not working , it always redirect me to index.php even if i clicked the link inside my wbesite. i tried to change the domain to many types like : http://www.domain.com www.domain.com domain.com domain but still the same problem 回答1: i found the solution, i just made a compare between

Prevent hotlinking image files

我们两清 提交于 2019-12-20 03:11:11
问题 I want to avoid hotlinking images. Basing of this answer: stackoverflow answer I've tried to add the next snippet code into .htaccess file: RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www.)?itransformer.es/.*$ [NC] RewriteRule \.(gif|jpe?g|png|wbmp)$ htttp://itransformer.es [R,L] but it is not working. When I try to access the images putting the path in the navigation bar, I can access. What am I doing wrong? 回答1: You're explicitly ignoreing referers

Performance: Absolute vs. Relative URLs

ε祈祈猫儿з 提交于 2019-12-19 06:05:28
问题 What's faster? Hot linking (inline linking) to an absolute URI or hosting the resource yourself and using a relative URI? In his tutorial on how to style HTML5 elements in Internet Explorer, Remy Sharp states that hot linking causes an "extra HTTP [GET] request." I agree if you're comparing hot linking to copying & pasting (embedding) the script into the HTML. But, if you're comparing hot linking to hosting the script locally and linking via a relative path, then I'd argue that hot linking is

Performance: Absolute vs. Relative URLs

纵然是瞬间 提交于 2019-12-19 06:05:08
问题 What's faster? Hot linking (inline linking) to an absolute URI or hosting the resource yourself and using a relative URI? In his tutorial on how to style HTML5 elements in Internet Explorer, Remy Sharp states that hot linking causes an "extra HTTP [GET] request." I agree if you're comparing hot linking to copying & pasting (embedding) the script into the HTML. But, if you're comparing hot linking to hosting the script locally and linking via a relative path, then I'd argue that hot linking is

Apache Hotlink Protection for Download Folder

眉间皱痕 提交于 2019-12-19 04:45:50
问题 I'm trying to avoid direct links from other sites to my site's downloadables. My exe,zip and msi files are under /files directory. How can I avoid direct links to them? Thanks in advance... 回答1: Add the following to a .htaccess file in your /files directory RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteRule .*\.(exe|zip|msi)$ /images/nohotlink.jpg [L] Change "mysite.com" to your domain and /images/nohotlink.jpg to an