禁止热链接1个特定的URL,但允许所有其他URL [英] Prevent hotlinking a 1 specific URL but allow on all others

查看:77
本文介绍了禁止热链接1个特定的URL,但允许所有其他URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道htaccess的方法可以防止在您自己的域之外的每个站点上进行热链接,但是如果可能的话,我需要更高级的方法

I know the htaccess method for preventing hotlinking on every site aside of your own domain but i need something more advanced if possible

我想允许对我的网站进行访问个人服务器和所有其他站点,但是却指出了一些选定的站点并禁止它们进行热链接

I would like to allow access on my personal server and all other sites , but yet pinpoint out a few select sites and ban them from hotlinking

我非常想允许所有并拒绝特定的IP或URL

pretty much i want to ALLOW ALL and deny a specific IP or URL

允许:
mywebdomain.com
allothersites.com

Allow : mywebdomain.com allothersites.com

预防:
donotallowthissite.com
donotallowthissite2.com

Prevent : donotallowthissite.com donotallowthissite2.com

这是否可能,如果可以,您可以分享如何实现它吗?

is this possible , if so can you share how to achieve it ty ?

我当前正在使用它来允许将我的所有文件热链接到具有多个服务器的第三方服务器,但是它太混乱了,无法继续向每个站点添加新服务器和直接ID,所以我想允许所有到服务器上的热链接,但是当我发现有人在版权保护我的材料时,我想专门阻止该网站和ID

I am currently using this to allow access to hotlink all my files to a 3rd party server with multiple servers , but its too confusing to keep adding new servers and direct ids to each site , so i want to allow ALL to hotlink from my server, but when i find someone copyrighting my material i want to block that site and id specifically

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?nitrografixx.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?www(2|32|26|3|29|7|5).myfantasyleague.com.+(15982|21316|51396|47164|64314|43757|43757|63884|72807|54905)$ [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?www(2|32|26|3|29|7|5).myfantasyleague.com.+(15982|21316|51396|47164|64314|43757|43757|63884|72807|54905).+$ [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?football(2|32|26|3|29|7|5).myfantasyleague.com.+(15982|21316|51396|47164|64314|43757|43757|63884|72807|54905)$ [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?football(2|32|26|3|29|7|5).myfantasyleague.com.+(15982|21316|51396|47164|64314|43757|43757|63884|72807|54905).+$ [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?football.+.myfantasyleague.com.+(mb|site_news|choose_schedule) [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?football.+.myfantasyleague.com.+(h2h|seed_playoff_teams|playoff_schedule_setup|general_playoff_setup|transaction_setup|randomize_schedule|set_draft_order|change_draft_pick|adjust|delete_adjustments|new_predraft|calculate|waivers|rearrange_schedule|accounting|delete_transactions|trades|history|save_award|delete_accounting|submit_lineups|franchise_setup|options|message|custom_waiver_order|commish_email_setup|invite_franchise_owners|league_calendar_setup|fee_setup|standings_setup|division_conference_setup|select_packaged_waiver_rules)$ [NC]

RewriteRule \.(jpg|jpeg|png|gif|js|css)$ - [NC,F,L]


推荐答案

尝试:

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^https?://(www\.)?donotallowthissite\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^https?://(www\.)?donotallowthissite2\.com [NC,OR]
RewriteCond %{HTTP_REFERER} ^$
RewriteRule \.(jpg|jpeg|png|gif|js|css)$ - [NC,F,L]

使用您要阻止的网站并使用 [OR] 标志。

Using the sites you want to block and using the [OR] flag.

因此,条件中列出的两个站点之外的任何其他站点都不会遵守规则。

So any other sites other than the two listed in the conditions will not hit the rule.

这篇关于禁止热链接1个特定的URL,但允许所有其他URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆