

Question: can I store my homepage in a CDN like Amazon's new CDN?? - petervandijck

Can I store my static html homepage in a CDN like Amazon's new CDN? How would that work? I know how it works with images and such, but not sure how it would work with html?
======
timf
You can serve html pages there like any other file.

It seems you could use a CNAME configuration to do top level hosting. But
you'd have to get someone to link to "index.html" explicitly since CloudFront
will not do this for you. So
"[http://example.com/index.html"](http://example.com/index.html) is definitely
do-able but you need to worry about "[http://example.com"](http://example.com)
and "[http://example.com/"](http://example.com/)

Objects in S3/CloudFront can have a trailing "/" as part of the name, so maybe
you could get around that issue somehow.

\--

More ugly, but you could alternatively put everything on a subdomain and do a
permanent redirect to CloudFront.

example.com is your webserver, redirects all traffic to the exactly right path
at "x.example.com/[....]" where "x.example.com" has CNAME pointer to
cloudfront (relative links from those files will resolve OK directly to
cloudfront URLs)

------
barredo
Maybe with and .htaccess file you can do this

    
    
      RewriteEngine On
      RewriteRule ^index.htm$ http://amazoncdnurl.com/xyz.html [L]
    

Edit: No, it doesn't work. It redirects you to the given URL. Sorry

------
petervandijck
Ok, thanks all. So it's basically not really doable.. :)

