![]() |
htaccess question
htaccess question:
Is this the proper format for blocking hotlinking by domain? sogclub being the domain that is hotlinking xxx being my (i wish) hehe domain RewriteEngine on RewriteCond %{HTTP_REFERER} !^http://(www\.)?sogclub.com(/)?.*$ [NC] RewriteRule .*\.(gif|jpg|jpeg|bmp)$ http://xxx.com/ [R,NC] Also, can you insert ip in place of domain name with this format? Thanks ex: RewriteEngine on RewriteCond %{HTTP_REFERER} !^http://(www\.)?65.125.235.178.com(/)?.*$ [NC] RewriteRule .*\.(gif|jpg|jpeg|bmp)$ http://xxx.com/ [R,NC] |
why not use the " deny" function in the httpd.conf file , since it is only for one specific domain.
|
Actually i'm getting hotlinked by several but they only show up in the ref log by ip
|
Quote:
<B>RewriteCond %{HTTP_REFERER} !^http://65.125.235.178[NC, OR] RewriteCond %{HTTP_REFERER} !^http://(www\.)?sogclub.com[NC] RewriteRule \.(gif|jpg|jpeg|bmp)$ http://xxx.com/ [R,NC]</B> |
Oh, and the target address in the rewriterule need not and really shouldn't contain "http://" and [R], unless you are redirecting to a different server. So, if you're just sending them to the top of your site, write that line as:
<B>RewriteRule \.(gif|jpg|jpeg|bmp)$ / [NC]</B> |
Quote:
Ok.. Thanks.. I'll try it out |
Quote:
|
Oops, glad you bumped this, I overlooked that you're going about this back-assedwards! Me bad!
THIS is what you want (No"<B>!</B>'s"): <B>RewriteCond %{HTTP_REFERER} ^http://65.125.235.178[NC, OR] RewriteCond %{HTTP_REFERER} ^http://(www\.)?sogclub.com[NC] RewriteRule \.(gif|jpg|jpeg|bmp)$ / [NC]</B> Sorry I didn't catch that first time around.... |
(bumping to make sure <B>save11</B> notices that last change. Otherwise, the only people able to view his images will be the hotlinkers!)
|
:(
|
i got a little htaccess question of my own.
what do i need to add to my htaccess file for a HTTP 301 moved page? |
Quote:
<B>Redirect permanent /old-missing-page-1.html http://www.your-url.com/new-replacement-page-1.html Redirect permanent /old-missing-page-2.html http://www.your-url.com/new-replacement-page-2.html </B> |
Quote:
|
Or, to prevent ANYONE from linking to your images...
RewriteEngine on RewriteOptions inherit RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://.*YOURDOMAIN/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://.*YOURDOMAIN:80/.*$ [NC] RewriteRule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ http://SOMEURL Be sure to replace YOURDOMAIN with your actual domain name, and replace SOMEURL with the URL that you want the surfer to go to should they actually click on the red X on the hot linkers site! |
Quote:
|
| All times are GMT -7. The time now is 11:24 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123