views:

242

answers:

1

Hi,

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

+1  A: 

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

RewriteEngine On
RewriteRule ^/images/(.*)$ http://...cdn.....com/$1 [L,R=301]

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.

Geoff
Sorry, just noticed I've given Apache mod_rewrite rules, but you're using IIS. The same rules apply as to why this is a bad idea, but the syntax will differ.
Geoff
Hi Geoff,Thanks for your response. Yes, cloudfiles doesn't currently offer the CNAME option, but will be implementing it sometime in the future.Since this option is unavailable, I guess I have no option but to wait. I hope this doesn't hurt my SEO!
Wild Thing
Serving page resources from a CDN should have absolutely no impact on your SEO at all. If you're worried that users may see the url, then you should question why users will be searching for resources that are associated with a page and not for the page itself. One assumes that the pages which your users actually load are served from your own domain and not from the CDN?
Geoff