Questions tagged [hotlinking]

Hotlinking is practice of displaying digital assets (such as: image, video, sound or other files) into a website by linking it from another site.

Filter by
Sorted by
Tagged with
9 votes
5 answers
5k views

How to prevent hot linking ("image theft" / "bandwidth theft") of ressources on my site?

I'm trying to write the "ultimate" anti hot linking .htaccess... You can find many examples/tutorials/generators on the net but many of them are wrong or incomplete (or even both). These are the ...
AlexV's user avatar
  • 179
4 votes
1 answer
627 views

Is .htaccess slowing down my dedicated server?

First of all, I consider myself more a programmer than a servers guy. I have a website where I receive about 3,000 visits per day, which I think is a lot less than the max capacity for a dedicated ...
David Robles's user avatar
4 votes
1 answer
1k views

How to enable hotlink protection without hardcoding my domain in the Apache config file?

Been surfing around for a solution for a couple days now. How do I enable Apache hotlink protection without hardcoding my domain in the config file so I can port the code to my other domains without ...
Jeff's user avatar
  • 1,426
3 votes
3 answers
7k views

how to prevent image hotlinking in nginx?

I am trying to implement image hotlink protection problem in nginx and I need help. I have a huge issue of my site's images being submitted to social networks like StumbleUpon with a direct link like ...
Abdulrahim safi's user avatar
3 votes
2 answers
12k views

Nginx - Allow access to folder directory only by referring URL

front-end web developer here. Sorry in advance. My company wants to store new builds of our software on our web server, running Nginx, provided by WP Engine. The file path for these builds would be ...
Jesse Rogers's user avatar
3 votes
4 answers
2k views

Apache 2: Prevent image hotlinking serverwide

I'm trying to block access to images on my server if they are linked from some common "baddies", i.e. sites with users that tend to use other peoples bandwidth: livejounal.com blogger.com myspace.com ...
BlaM's user avatar
  • 3,936
2 votes
2 answers
2k views

How to track hits/viewing activity on an image file?

First and foremost, please forgive me if this is in the wrong section. I always seem to pick the wrong site when it comes to computer questions. In the air of recent, wildly viral internet events, my ...
Brandon's user avatar
  • 21
2 votes
1 answer
470 views

Blocking image hotlinking on nginx running Ghost also breaks images on valid domain

I'm running Ghost on nginx 1.14.0 and Ubuntu 18.04. I am trying block image hotlinking by external sites. I've added the recommended code from this post (starts with location ~* .(gif|png|jpe?g)$) to ...
pk192837465's user avatar
2 votes
2 answers
962 views

.htaccess hotlink prevention isn't working

I am running Wordpress blog and one "gentleman" is stealing my posts. I've decided to make his life difficult and I would like to prevent hotlinking images from my blog. I used htaccesstools com/...
wojcieh's user avatar
  • 158
2 votes
1 answer
185 views

Prevent hotlinking within the same website using .htaccess

The problems I'm facing is how to prevent hotlinking from within a website. What I want to do is to block www.website.com/user/xxx from hotlinking a CSS, but allow www.website.com/user/aaa to use the ...
John Smith's user avatar
1 vote
5 answers
4k views

How can I prevent hotlinking? (nginx)

I use nginx and I have no access to server conf. May be with .htaccess analogue?..
NARKOZ's user avatar
  • 1,008
1 vote
2 answers
523 views

Are there any drawbacks to disabling hotlinking using .htaccess?

I've been seeing a lot of requests for images hosted on my server from other websites. Rather than allow this to carry on, I'm considering using mod_rewrite and .htaccess to prevent this using ...
chrisbunney's user avatar
1 vote
2 answers
7k views

Trouble in Nginx hotlink protection

I am trying to implement image hotlink protection problem in nginx and I need help. I have a huge issue of my site's images being submitted to social networks like StumbleUpon with a direct link like ...
Ayaz Malik's user avatar
1 vote
2 answers
4k views

How do I disable hot linking and direct linking to files on my site?

Ok, I've beat my head against the wall for a few hours now and this just isn't working. Below are the contents of my .htaccess file. What I'm trying to do is block access to a set of pdf and mp3 files ...
Mike Taber's user avatar
1 vote
3 answers
2k views

Apache 2: Is Referer from current Host

I have an Apache 2 with mod_setenvif. My goal is to stop all hotlinking of images in my global apache.conf. Currently that's: <FilesMatch ".(gif|jpg|jpeg|png)$"> SetEnvIfNoCase Referer "^...
BlaM's user avatar
  • 3,936
1 vote
1 answer
1k views

mod_secdownload for Apache 2.x

Is there something like mod_secdownload (which is available for lighttpd) also available for Apache 2.x? The mod provides expiring URLs, so that it is possible to prevent hotlinking of files. A ...
BlaM's user avatar
  • 3,936
1 vote
1 answer
310 views

How to prevent hotlinking for subdirectories only?

I want to prevent hotlinking to all subfolders in /var/www/store but at the same time allow linking to its index page. I tried doing this: <Directory "/var/www/store"> DirectoryIndex index....
Question Overflow's user avatar
1 vote
1 answer
3k views

IIS 7 URL Rewriting Rule for images not referred by the website itself

New to URL rewriting with IIS 7. I need to redirect to another page for images not referred by the website itself. For example is someone enters "www.somesite.com/images/image001.jpg" into their ...
user avatar
1 vote
1 answer
96 views

Add a subdomain as an exception in hotlinking

I used this code in my .htaccess file and it is working great to prevent hotlinking: RewriteEngine On RewriteCond %{HTTP_HOST}@@%{HTTP_REFERER} !^([^@]*)@@https?://\1/.* RewriteRule \.(gif|jpg|jpeg|...
jeff's user avatar
  • 11
1 vote
0 answers
70 views

Reverse proxy server hotlinking problems

I got the next problem: Have front-end proxy server, that points to my back-end server. Someone is steeling bandwith true my images so I want to block this from happening. I use a proxy.conf file ...
fufu's user avatar
  • 11
1 vote
0 answers
1k views

nginx hotlink protection for missing referer, but allow direct URL request

I'm using the following hotlink protection for Nginx I found from this page: https://nixcp.com/anti-hotlinking-nginx/ I use this code: location ~* \.(gif|jpg|jpeg|png|webp|svg|ico)$ { ...
Steven Vorchk's user avatar
1 vote
0 answers
419 views

disable direct file access on lighttpd

I'll be fast: Is there a way to block direct file access to files/images on my /var/www? So for example: If I am loading the page example.com/info.php that contains the image hello.jpg, can I block ...
john smith's user avatar
1 vote
0 answers
450 views

nginx Anti-HotLinking configuration

I was wonder with nginx can I: Check if content-type == "image/x-jpeg" || content-type == "image/png" || content-type == "image/gif" If true && referrer != "mysite.com" && referrer !=...
unixman83's user avatar
  • 1,952
1 vote
0 answers
705 views

Hotlink Protection in Nginx working too well in Firefox

I use hotlink protection in Nginx and it is working very well! For some reason it is not allowing visitors to my site using Firefox to see any images. For visitors using IE, Chrome, Safari, and Opera,...
Adergaard's user avatar
0 votes
1 answer
2k views

403 Hotlinking is forbidden [closed]

We have a website that generates simple links based in anchor tag to another site. But, when we click in these links, the following error is displayed: Error 403 Hotlinking is forbidden Hotlinking ...
Marcelo Juventino's user avatar
0 votes
2 answers
646 views

EV SSL Certificates and linking to static files through Amazon S3/Cloudfront

I have been considering getting an EV SSL certificate for my website, but I have some concerns about how this will interact with our planned architecture. We were planning to serve our static files ...
schizodactyl's user avatar
0 votes
2 answers
1k views

Nginx - prevent a .php file running on anything but your own server/domain?

We have an mp3 player that runs via an iFrame, not our choice but thats how we're stuck with it. We want to prevent other people simply embedding the iframe on their site. What would be the best way ...
Danny Shepherd's user avatar
0 votes
2 answers
612 views

nginX hot linking protection failing

I have the fallowing configuration to disable hotlinking on nginX. location / { root /var/www/html; index index.html index.htm; } location ~ \.(xml|jpg|jpeg)$ { ...
Jose Febus's user avatar
0 votes
1 answer
223 views

Hot link prevention not working

I am trying to prevent hot linking of images on our site. I have tried editing /etc/httpd/conf/httpd.conf by adding the following to the end of the file: <VirtualHost *:80> ServerName www....
oshirowanen's user avatar
0 votes
2 answers
2k views

Nginx Prevent hotlinking with exception

I'm trying to implement download hotlinking protection. I've this code location /download/ { valid_referers blocked server_names *.example.com; if ($invalid_referer) { ...
Kurogane's user avatar
0 votes
1 answer
188 views

Hotlinking prevention returns 404 error NGINX

Can somebody tell me why this snippet return 404 when I'm trying to access images directly or from the original site (by link). location ~* \.(ico|jpeg)$ { valid_referers none ...
Andrew's user avatar
  • 105
0 votes
1 answer
2k views

Prevent hotlinking on Nginx

I'm trying to protect my images from hotlinking. My first approach was this: location ~* \.(png|jpg)$ { valid_referers none blocked server_names; if ($invalid_referer) { return 403; ...
Nepo Znat's user avatar
  • 299
0 votes
1 answer
2k views

nginx hotlinking prevention

I know this is quite a basic question, but whereas i had no problem preventing image files from hotlinking, i can't figure out how i can't protect mp4 video files… i just tried to specify mp4 next to ...
Buzut's user avatar
  • 825
0 votes
2 answers
323 views

Prevent hotlinking at DNS level

I used my own server to host an example file (an image) when I posted an answer to a question at StackOverflow. Now someone has copied the code I used, including the URL to the file on my server. The ...
Tatu Ulmanen's user avatar
0 votes
1 answer
273 views

URLs with final slash trigger hotlink protection on my server

in all my Apache servers I use hotlink protection because I hate the idea someone could stick my images/flash in their sites using my server bandwidth. In order to make hotlink protection work, in my ...
Marco Demaio's user avatar
0 votes
1 answer
179 views

Any way to stop people from img "framing" your site?

Someone was trying to get cute with me, by "iframeing" my search result page via an IMG tag with 0 width and 0 height, in hopes of killing my server resources. My searches are cached, so it doesn't do ...
user avatar
0 votes
0 answers
42 views

Prevent hot link nginx specific domain page

I have the following code on nginx to prevent hotlink location ~ ^/(.*\.(jpe?g|png|gif))$ { valid_referers none blocked domain1.ext *.domain2.ext *.domain3.ext; if ($invalid_referer) { ...
Marco's user avatar
  • 1
0 votes
0 answers
62 views

Hotlink protection in nginx not working

This is the system of servers that I'm building upon. original-website.com duplicate-website.com unallowed-duplicate-website.com I put some content in original-website.com. <!DOCTYPE html> <...
achhainsan's user avatar
0 votes
0 answers
146 views

Nginx prevent hotlinking and redirect not work with new Nginx version

In the past, this works perfectly: #domain1.com location /files/ { valid_referers none blocked domain1.com domain2.com domain3.com; if ($invalid_referer) { return 403; } if (!-...
Phạm Thanh Tùng's user avatar
0 votes
1 answer
123 views

Adding rewrite code to prevent hotlinking in a htaccess file in wordpress

I wish to alter the standard .htaccess file in wordpress to prevent hotlinking to our files in the uploads folder. I have put together the code below but sadly the files still are accesible directly, ...
user3263070's user avatar
0 votes
1 answer
167 views

Hotlinking protection in nginx made my domain images disappear

After adding the hotlinking protection code to the server block, none of the images now loads. Here is the complete server block code of the web server in question: server { listen 443 ssl; ...
CelestialEX's user avatar
0 votes
0 answers
43 views

Hotlink prevention without relying on referer?

Is there a way to stop the hotlinking of images without relying on referers? I searched for hours and all seem to do the same, problem is i must allow empty referers and when i access the site ...
Michael Rogers's user avatar
0 votes
1 answer
235 views

NGINX deny access to folder via addres bar but allow access from script or HTML

Is it possible to do this thing? I'm trying to deny all and allow localhost in /location in nginx config but this does not work. This is struct my files: index.php templates/__NEW/ (here are files ...
furyxpl's user avatar
0 votes
1 answer
262 views

Hotlink protection with SHA-256

I'm using hotlink protection in a nginx server with set_misc_nginx_module using sha-1,I'd like to change this to sha-256, My current settings are this: root /var/www/streamboat.tv; set $secret "...
Nexdevs's user avatar
0 votes
1 answer
602 views

Nginx Hotliking protection pointing at a specific image (nginx as reverse proxy)

I am using nginx as a reverse proxy with apache. I have added this code to prevent hotlinking, and it is working fine so far. #hotlinking protection location ~* \.(png|gif|jpg|jpeg)$ { ...
Angelos Kyritsis's user avatar
0 votes
1 answer
148 views

Possible to prevent hotlinking when apache server has no domain name?

I have a LAMP + Wordpress server that I access with the IP address only. I don't plan on getting a domain name for the server. I want to know if it is possible to prevent hotlinking of resources if ...
sogosu's user avatar
  • 1
0 votes
2 answers
206 views

cPanel/Apache Hotlink protection performances

Does anyone have an idea of what's the impact on a website performances when activating Hotlink protection on server. FYI: hotlink protection disallows other websites on other servers to place an ...
Marco Demaio's user avatar
0 votes
3 answers
2k views

nginx hotlinking prevention with cloudflare

I want to prevent hotlingking in my site. However I also have cloudflare to serve my site. I don't want to use cloudflare hotlinking protection feature as it cannot exclude external domain that I ...
dev-jim's user avatar
  • 313
-1 votes
1 answer
1k views

how to protect from hotlink in nginx

I need to protect from hotlinks in my php site.? how Can i achieve this ?? Iam using nginx as webserver .. If I try to view site.com/uploads/image.jpg without login I can able to see images in ...
vijoy's user avatar
  • 1
-3 votes
1 answer
2k views

How to change .htaccess file to work right in localhost? [closed]

I have this snippet code in my .htaccess file to prevent users from hotlinking the server's images: RewriteEngine On RewriteCond %{HTTP_REFERER} ^$ [OR] RewriteCond %{HTTP_REFERER} !^http://(www.)?...
Manolo's user avatar
  • 562