| Author |
|
whizzinisapi Groupie

Joined: 21 May 2004 Location: United States
Online Status: Offline Posts: 50
|
| Posted: 24 February 2010 at 6:12pm | IP Logged
|
|
|
Can we add a rule to isapi rewrite to block others from hotlinking? Basically, do what hotlink blocker does with isapi rewrite.
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10489
|
| Posted: 25 February 2010 at 3:01am | IP Logged
|
|
|
"Basically, do what hotlink blocker does with isapi rewrite." - well, it's not possible in full, but here's the best you can do:
[ISAPI_Rewrite]
RewriteCond Host: (.+)
RewriteCond Referer: (?!http://\1.*).*
RewriteRule .*\.(?:gif|jpg|png) /block.gif [I,O]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
whizzinisapi Groupie

Joined: 21 May 2004 Location: United States
Online Status: Offline Posts: 50
|
| Posted: 04 March 2010 at 2:06pm | IP Logged
|
|
|
Thank You. We already have some rules in our httpd.ini... how would i add that without it conflicting with anything else.
Below is an example of our httpd.ini.
RewriteCond Host: ^widgets\.com
RewriteRule (.*) http\://www\.widgets.com\.com$1 [I,RP]
RewriteCond Host: (.*)
RewriteRule /bluewidgets(/.*) http\://$1/redwidgets$2 [I,RP]
RewriteRule /([^./]+\.htm) http://www.widgets.com/redwidgets/us/$1 [I,RP,L]
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10489
|
| Posted: 05 March 2010 at 4:05am | IP Logged
|
|
|
You should put the blocking portion at the top of your config:
[ISAPI_Rewrite]
RewriteCond Host: (.+)
RewriteCond Referer: (?!http://\1.*).*
RewriteRule .*\.(?:gif|jpg|png) /block.gif [I,O]
RewriteCond Host: ^widgets\.com
RewriteRule (.*) http\://www\.widgets.com\.com$1 [I,RP]
RewriteCond Host: (.*)
RewriteRule /bluewidgets(/.*) http\://$1/redwidgets$2 [I,RP]
RewriteRule /([^./]+\.htm) http\://www.widgets.com/redwidgets/us/$1 [I,RP]
__________________ Regards,
Anton
|
| Back to Top |
|
| |
whizzinisapi Groupie

Joined: 21 May 2004 Location: United States
Online Status: Offline Posts: 50
|
| Posted: 05 March 2010 at 2:27pm | IP Logged
|
|
|
Thanks Anton... one more thing. It seems this is effecting
https requests on our own domain. any page that is https is
not displaying the images.
|
| Back to Top |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10489
|
| Posted: 09 March 2010 at 5:10am | IP Logged
|
|
|
Ok, let's fix the config like this:
[ISAPI_Rewrite]
RewriteCond %HTTPS (?!on).*
RewriteCond Host: (.+)
RewriteCond Referer: (?!http://\1.*).*
RewriteRule .*\.(?:gif|jpg|png) /block.gif [I,O]
RewriteCond %HTTPS (?!on).*
RewriteCond Host: ^widgets\.com
RewriteRule (.*) http\://www\.widgets.com\.com$1 [I,RP]
RewriteCond %HTTPS (?!on).*
RewriteCond Host: (.*)
RewriteRule /bluewidgets(/.*) http\://$1/redwidgets$2 [I,RP]
RewriteCond %HTTPS (?!on).*
RewriteRule /([^./]+\.htm) http\://www.widgets.com/redwidgets/us/$1 [I,RP]
__________________ Regards,
Anton
|
| Back to Top |
|
| |