Posted by Trogdor at 7:46am Aug 9 '09
You must sign in to send Trogdor a message
You must sign in to send Trogdor a message
#Coralise
RewriteCond %{HTTP_USER_AGENT} !^CoralWebPrx
RewriteCond %{QUERY_STRING} !(^|&)coral-no-serve$
RewriteRule ^/(.*)$ http://4cache.lankyland.com.nyud.net:8080/$1 [R,L]
Line 1 says, if this request is coming from a Coral Caching server do not redirect.
Line 2 says, if the Coral CDN has redirected back to the origin server do not redirect
Line 3 says, redirect everything else to its Coralized URI
Line 1 is very important, without it we get an infinite loop as Coral would not be able to grab and cache the original file.
Line 2 is important as sometimes if you use too much Coral Bandwidth the Coral servers can bounce back to the original source. It just ads ?coral-no-serve to the end of the URL.
Line 3 just rewrites all addresses to use the Coralized URL. Example: http://4cache.lankyland.com/index.php is actually http://4cache.lankyland.com.nyud.net:8080/index.php
If you don't want to use the mod_rewrite service and you have a smaller site you can use it just for larger files.