On 3 Mar 2006, at 02:24, A. Khattri wrote:
I have a web server with a virthost that has huge amounts of traffic
because everyone (and his grandmother) links to images in that site.
I was wondering if there was a clever way to check the referrer
page and
deny requests for pages that are *not* on the site?
What do you mean by clever?
The "dumb" way is doing something like this (not tested)
RewriteEngine On
RewriteCond %{REQUEST_URI} !\.(html|php|other)$ # Allow
requests for pages
RewriteCond %{HTTP_REFERER} !^$ # Allow if
referrer is blank (you might want to change this)
RewriteCond %{HTTP_REFERER} !^allowedsite.com$ # Allow if
referrer is known site
RewriteRule (.*) - [F] # Deny other
requests
Ive also installed mod_throttle too and would love to manage total
bandwidth per virthost (i.e. set a total of say, 5Gb per month, and
after
that deny requests).
It's not perfect but I think this will do nearly what you want
ThrottlePolicy Volume 5G 4W # Throttle based on volume of 5Gb over
4 weeks.
Yours,
Craig
--
Craig Webster | t: +44 (0)131 516 8595 | e: [EMAIL PROTECTED]
Xeriom.NET | f: +44 (0)131 661 0689 | w: http://xeriom.net
"Te audire non possum. Musa sapientum fixa est in aure" - Unknown
--
[email protected] mailing list