简体   繁体   中英

IIS / Helicon ISAPI Rewrite Hotlinking Protection

I am using a shared hosting package with ISAPI Rewrite 3 installed. The problem is that when I try to amend the .htaccess to prevent hotlinking, it doesn't work. Does anyone have experience of ISAPI Rewrite that can shed light on what I'm doing wrong. I put the file is put into the same directory as Default.aspx. The .htaccess is :-

[ISAPI_Rewrite]
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?example.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?example.net [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?example.co.uk [NC]
RewriteRule \.(jpg|jpeg|gif)$ - [NC,F,L]

Is the syntax right or something else is the case? As always, your help is appreciated.

Try to add "RewriteBase /", but everything else looks good. It could be smth in your permissions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM