Using htaccess to enable hotlink protection

Question
How do I use htaccess to enable hotlink protection?
Answer
You can add the following code in your .htaccess file to enable hotlink protection:
SetEnvIfNoCase Referer    "^http://www.example.com/" locally_linked=1
SetEnvIfNoCase Referer "^http://www.example.com$" locally_linked=1
SetEnvIfNoCase Referer "^http://example.com/" locally_linked=1
SetEnvIfNoCase Referer "^http://example.com$" locally_linked=1
SetEnvIfNoCase Referer "^$" locally_linked=1

Order Allow,Deny
Allow from env=locally_linked
Still need help?
If you need further assistance than this entry provided, please, do open up a support ticket, we are here to help you out
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Do I need to restart Apache when I change an .htaccess file

Question Do I need to restart Apache when I change an .htaccess file Answer No, you do not...

URL redirect/rewrite using the .htaccess file

Question How do I create rewrites using .htaccess files?...

what is mod_rewrite? How do I get redirects working?

Question What is mod_rewrite? How do I get it working? Answer Our servers do...

How to use a SWF file as your homepage without embedding it into an HTML page.

Question How to use a SWF file as your homepage without embedding it into an...

Force SSL on all pages.

Question How do I force HTTPS instead of HTTP Answer...

Powered by WHMCompleteSolution

Our official partners