Viewing 1 post (of 1 total)
  • Author
    Posts
  • #355493
    legacyb4
    Participant

    While not specifically OS X Server related, those of us who do run content-serving webservers sometimes find bandwidth being consumed by deep links in forums and other venues.

    Sometimes, this is desirable if it’s helping getting word on your site out, but it’s too often abused and just causes needless traffic.

    A simple fix which seems to work for a lot of the vBulletin and other forums sites is to stick a simple .htaccess file in the root of the directory containing the content you want to protect.

    [b:30ddfcecde][code:1:30ddfcecde]
    RewriteEngine On

    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://www.apexjapan.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://apexjapan.com/.*$ [NC]
    RewriteRule .*\.(gif|GIF|jpg|JPG)$ http://www.apexjapan.com/images/error.gif [R,L]

    [/code:1:30ddfcecde][/b:30ddfcecde]

    What this does is filter any incoming request for .gif or .jpg files in that directory and redirects the request to any URL (in my case, an error.gif) that you may wish to use.

    Original tip from:

    [b:30ddfcecde][url=http://www.janey.net/tutorials/htaccess_tutorial.html]Janey.net[/url]
    [/b:30ddfcecde]

    Hope this is of some help to admins.

    Cheers.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Comments are closed