2

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

我想允许访问我的个人服务器和所有其他站点,但要指出一些选定的站点并禁止它们进行盗链。

几乎我想允许所有并拒绝特定的 IP 或 URL

允许:mywebdomain.com allothersites.com

防止:donotallowthissite.com donotallowthissite2.com

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

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

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]
4

1 回答 1

0

尝试:

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]标志。

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

于 2013-11-07T21:02:05.153 回答