• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
Old Gamess

Old Gamess

Free Games and Software Download

  • Home
  • Software
    • Antivirus
    • MS Office
    • ISO Tool
  • Windows OS
  • Mac OS
  • PC Games
  • Emulators
    • PlayStation 1 Emulator
    • PlayStation 2 Emulator
    • PlayStation 3 Emulator
    • Nintendo 64 Emulator
    • GameCube Emulator
  • Android
  • Code
  • Blog

What is Hotlink Protection? How to use it?

January 18, 2023 by Admin Leave a Comment

Hotlink protection is a technique used to prevent other websites from linking to your images and other media files, thus stealing your bandwidth and slowing down your website. One way to implement hotlink protection is by using the .htaccess file on an Apache web server.

Here is an example of an .htaccess code that will prevent hotlinking of images on your site:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]

This code uses the mod_rewrite module of Apache to check the HTTP referer (the website that is linking to your images), and if it is not your own website, the request will be denied and the image will not be displayed.

You can replace yourdomain.com with your own domain name and also you can add or remove the extensions you want to protect. The code above will only block jpg, jpeg, png and gif files, however you can add or remove file extensions as per your requirement.

You should be careful with the use of .htaccess files as it can cause errors or security issues if not properly configured. Another approach is using the CDN (Content Delivery Network) which generally provides this feature as well.

Share this:

  • Twitter
  • Facebook

Related

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Subscribe my YouTube Channel

Popular Posts

  • GTA Vice City Download For PC
  • GTA San Andreas Download For PC
  • Windows XP ISO Download
  • Top 10 Anime Websites to Watch Free Anime Online

Follow Us

  • Facebook
  • YouTube

Footer

HOME  |   ABOUT  |  DMCA  |  DISCLAIMER  |  PRIVACY  |  CONTACT
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright © 2023 ยท [oldgamess.com]