You’ll need to create a cname DNS record for the subdomain (cdn.domain.com) and point it to your cloudfront CDN URL.
Thanks for your reply, Patrick! 🙂
I’m assuming, once the subdomain points to my CDN URL (a separate one from the “main” I use for w3tc), I should like the cloudfront distribution to the s3 bucket that has the static files. Is that correct?
Hm. I tried creating a cname DNS record for the subdomain I created on dreamhost, but It’s not allowing me to do it.
I have created DNS records before, but only on the main domain (astromono.com), but this time when trying it on a subdomain I get the following error:
You already have a record for this name. You can't have a CNAME and any other record on the same name.
Apparently, dhost doesn’t allow me to just leave the name of the DNS record as “cdn.astromono.com”, requiring me to enter something before the subdomain URL (i.e. something.cdn.astromono.com). Will that work?
You’re trying to edit the DNS for astromono.com right?
I just tested on my account and I can add a subdomain of CDN.
Name: cdn
Type: CNAME
Value: cdn-test.domain.com
What values were you using?
I’m using the following values on a subdomain named “cdn.astromono.com”:
Name: I’m leaving it blank for “cdn.astromono.com” (as per instructions on the dhost page there)
Type: CNAME:
Value: “www.astromono.com”
I’m now quite certain I’m doing it wrong, since I created the subdomain and I’m trying to input this information on the subdomain DNS. I’m assuming I should be adding this info in the actual domain, am I correct?
Thanks for your help, Mika. You’re like a caped crusader with hyper-patience superpowers!
Also, I found this information regarding using subdomains as cookieless domains:
If your website uses the root domain (example.com as opposed to http://www.example.com ,for instance) to serve traffic and uses Google AdSense, you cannot make a cookieless domain as a sub-domain and MUST use an alternative domain name. The reason for this is that the Google AdSense code sets cookies on the requested domain and all sub-domains. They do not allow you to override this behavior.
If my FTP is anything to go by, my domain root points to astromono.com instead of http://www.astromono.com, so I guess I need a separate domain to store my static files.
I’m now quite certain I’m doing it wrong, since I created the subdomain and I’m trying to input this information on the subdomain DNS. I’m assuming I should be adding this info in the actual domain, am I correct?
Yeah, that’s where you went bibbeldy 🙂
Delete the subdomain. Then go edit the DNS for the main domain and add it there.
Thank you for clarifying that!
Once it’s been added, what should I do? Say instead of making the CNAME point to http://www.astromono.com I make it point to a distribution on amazon cloudfront. Should I do any edits to the wp-config.php afterwards?
IIRC it’s adding in this:
define('COOKIE_DOMAIN','astromono.com');
but I’m not 100% sure that works the way you want it to.
Oh man. I don’t know if that works the way I want it to either! Now I’m anxious!
The point of the cookieless domain is to lower http requests to the server so astromono.com will load faster. I’ll test it and then we’ll see how it goes. Man… this is scary