Quote:
Originally Posted by homebrewpcgaming
Hello,
Ok, I have a file: downloadzip.php?id=WHATEVERNUMBER
I do not want this file to be hotlinked to (other PHP files are fine), so I only want that one file to be protected.
When someone hotlinks to downloadzip.php?id=WHATEVERNUMBER I want them to be redirected to showgame.php?id=WHATEVERNUMBER
What would I put in .htaccess?
Thank you!
Matthew Kremer
|
Code:
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?yoursite\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule downloadzip.php\?id=(\d+)$ showgame.php\?id=$1 [L]
You'll also need to replace yoursite\.com .