3 ms·
Easier: just put this into your .htaccess on traffic spike. Header append X-Coral-Control "redirect-home" RewriteCond %{HTTP_USER_AGENT} !^CoralWebPrx
by sirn 15y ago
Easier: just put this into your .htaccess on traffic spike.
Header append X-Coral-Control "redirect-home"
RewriteCond %{HTTP_USER_AGENT} !^CoralWebPrx
RewriteCond %{QUERY_STRING} !(^|&)coral-no-serve$
RewriteRule ^(.*)$ http://your.domain.nyud.net/$1 [R,L]
Or even better, just redirect all traffic with news.ycombinator.com or reedit.com referer (before RewriteRule):
RewriteCond %{HTTP_REFERER} ^http://([^/]+\.)?ycombinator\.com [OR]
RewriteCond %{HTTP_REFERER} ^http://([^/]+\.)?reddit\.com [OR]
You don't even have to manually disable caching after traffic dies down this way.