or when this site gets sudden heavy traffic (called being "slashdoted" or
"flash crouds") I will upload these four lines to my site as a text file
named ".htaccess" which redirects my unserveable level of traffic to the
Coralcdn.org 260 volunteer server distribution network until my traffic
drops down to a level I can handle again, at which point I will delete this
".htaccess" text file and accept my own traffic again.
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !^CoralWebPrx
RewriteCond %{QUERY_STRING} !(^|&)coral-no-serve$
RewriteRule ^(.*)$ http://www.yourdomain.com.nyud.net/$1 [R,L]
Lines 2 is there so coralcdn.org can always have access to my files and they
can do the mirroring onto their 290 servers without being redirected from my
site like everybody else. Line 3 is critical as it stops a dangerous feedback loop
when coral occasionally sends a visitor back to the real site.
Also I made sure my entire site has relative paths for all links and
graphics so while visitors are surfing my site on coralcdn.org, they
don't get knocked backed to my real server again, and they stay at the
coral distribution address.
The dot before ".htaccess" makes the file invisible, so the quickest way
to delete it, is to upload the ".htaccess" again and then delete it before
it turns invisible. But be careful you don't overwrite an important allready
existing ".htaccess" file, already there but invisible. An ftp client program
will have a preference somewhere to show filenames starting with a dot.
(I think windows servers don't use ".htaccess" files but I'm not sure.)
You can have a look at my two voting ladders then "view source" to see
the javascript coding I'm doing to disable the vote button with a popup
explanation whenever the page is being viewed within the coralcdn.org
distribution network. My guestB00K was too complicated for me to disable
the "submit" button, but I did put in a javascript pop up "won't work" warning
for whenever the guestB00K signing page is being view within the coralcdn.org
network.
I successfully handled my huge Valentine's Day traffic with this plan of
action, so I'll be doing this every year at Valentines.
If I ever get more temporary traffic than I can handle for a specific file or two, then
I will use the following ".htaccess" file to temporarily redirect only those problem files.
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !^CoralWebPrx
RewriteCond %{QUERY_STRING} !(^|&)coral-no-serve$
RewriteRule ^(test1.jpg)$ http://www.yourdomain.com.nyud.net/test1.jpg [R,L]
RewriteCond %{HTTP_USER_AGENT} !^CoralWebPrx
RewriteCond %{QUERY_STRING} !(^|&)coral-no-serve$
RewriteRule ^(test2.jpg)$ http://www.yourdomain.com.nyud.net/test2.jpg [R,L]
And here is the ".htaccess" coding I will be using If I need to redirect heavy traffic
from an entire images folder etc.
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !^CoralWebPrx
RewriteCond %{QUERY_STRING} !(^|&)coral-no-serve$
RewriteRule ^images/(.*)$ http://www.yourdomain.com.nyud.net/images/$1 [R,L]
RewriteCond %{HTTP_USER_AGENT} !^CoralWebPrx
RewriteCond %{QUERY_STRING} !(^|&)coral-no-serve$
RewriteRule ^photos/(.*)$ http://www.yourdomain.com.nyud.net/photos/$1 [R,L]
I'm not a strong coder. These are just things my quick researching turned up. So
they maybe very incorrect. But they did work as I wished in testing. I am putting them
here for my own reference during bandwidth emergencies, and for my family to see and
implement if I am unavailable.
One more thing. To allow my own ip address to access my own site like normal I would
use the following code.
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^xxx.xxx.xxx.xxx$
RewriteCond %{HTTP_USER_AGENT} !^CoralWebPrx
RewriteCond %{QUERY_STRING} !(^|&)coral-no-serve$
RewriteRule ^(.*)$ http://www.yourdomain.com.nyud.net/$1 [R,L]
Be sure to read how wikipedia.org explains the Coralcdn.org project.
http://en.wikipedia.org/wiki/Coral_Content_Distribution_Network
and the slashdot effect.
http://en.wikipedia.org/wiki/Slashdotted
To worry is the warmest weapon,
if only all men had fear.
In corners they could lay and reckon,
and at worst defend by leer. |
|
You know how some people respond to rain,
wanting to control it's sum.
By tearing their fingers off in complaint,
if two does not equal one. |
Man Against Eternity Tour
