: How can i use the HTTP_REFERER to come from a specified domain name I know the HTTP_REFERER method has a security loop, but it most cases it works fine. How can i use it, to limit how a
I know the HTTP_REFERER method has a security loop, but it most cases it works fine. How can i use it, to limit how a user see other pages on my website, instead of just directly clicking on the link or pasting it on the browser. Specifically, i want the referer to only work if the referred url came from the same domain name? And not from another source.
More posts by @Karen161
1 Comments
Sorted by latest first Latest Oldest Best
With Apache, to protect a directory (e.g. your /images directory) something like this in a .htaccess file works:
RewriteEngine On
RewriteCond %{HTTP_HOST};%{HTTP_REFERER} !^([^;]+);http://1(/.*)?$
RewriteRule .* /please_dont_hotlink.html [R]
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.