开发者

Longish list of allowed referrers

I want to allow hotlinking only from a list of referrers (paying customers, probably a few hundred).

I am on Apache 1.3 and I do not have access to the configuration (only .htaccess).

What is the fastest way to implement this?

My thoughts so far:

  • PHP with database and readfile()

  • (SSI with) Perl and database

  • the list implemen开发者_JAVA百科ted as symlinks named after the allower referrer, then RewriteCond using HTTP_REFERER

  • everything in .htaccess, lots of RewriteCond's

  • everything in .htaccess, lots of SetEnvIf's

Any better (faster) ways to do this? Thanks!


I vote for PHP with database and readfile(), presuming readfile() will also write any updates to the .htaccess, and has permission to do so on the file-level.

That way, you can create a nice backend to manage your whitelist, repackage your efforts into a proper open source project, and have proper backup and integrity of your data.

If you want speed, time how long they all take, and let us know your results.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜