I am using Rackspace Cloud CDN (Limelight CDN) for my website. The URLs of the CDN are in the format
http://cxxxxxx.cdn.cloudfiles.rackspacecloud.com/something.jpg
My domain is mydomain.com.
Can I use IIS URL rewriting to show http://cxxxxxx.cdn.cloudfiles.rackspacecloud.com/something.jpg as http://images.mydomain.com/something.jpg? Or is this impossible without the CDN setup accepting my CNAME?
If so, can you please help create the URL rewrite rule? (Sorry, don’t know how to use regular expressions)
Thanks,
WT
You cannot do this with a url rewrite rule, as that happens on your server.
One of the primary advantages of a CDN is to provide many points of access much closer to the user than your server may be. Using a round trip to your server completely destroys this advantage.
You can write a redirect rule to go from somewhere on your site that then sends the browser to the CDN, but the user will see the url of the CDN, (i.e. it won’t be hidden).
To do so, consider something like
If you’re writing in a .htaccess file instead of in the server config file, then drop the first / after the ^.
As you alluded to, if you could get cloudfiles to accept a CNAME that pointed to their hostname, then it would be possible so simply replace your hostname with yours. However, I assume that by asking this question, you’ve already explored that avenue.