• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Apache mod_rewrite + hotlink protection

versello

2[H]4U
Joined
Nov 19, 2003
Messages
2,061
I'm running Apache 2 on a Win32 platform, and I can't seem to get hotlink protection working.

I've uncommented "LoadModule rewrite_module modules/mod_rewrite.so" in the .conf file and restarted apache, and I have AllowOverride All in my httpd.conf. .htaccess does work fine, as I am able to set options in it and it works fine.

Now when I'm trying to make an .htaccess to prevent hotlinking, it doesn't do anything. In it is:

Code:
RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !^http://my_domain/.*$      [NC]

RewriteCond %{HTTP_REFERER} !^http://www.my_domain.com/.*$      [NC]

RewriteCond %{HTTP_REFERER} !^http://my_ip_address/.*$      [NC]

RewriteRule .*\.(jpg|jpeg|gif|png|bmp|rep|rar|zip|w3g).*$ - [G,L]

Please help.
 
By "doesn't do anything", do you mean "doesn't prevent hotlinking"? Your rules look pretty solid, though I'd probably make some minor changes that shouldn't really affect anything (like removing the final ".*" in your RewriteRule). Are you absolutely sure it's not a configuration problem? Does a simple rewrite work? For example, just make a rule "RewriteRule foo.html bar.html" and see if you get redirected properly.
 
I did what you mentioned. I didn't get redirected :( Guess mod_rewrite isn't functioning?

What else do I have to do to get this functioning?
 
Glad to hear. Sorry I couldn't be more directly helpful. What did it take to get it working? Was it a configuration issue, or was there something wrong with the rewrites?
 
Back
Top