10

If you look closely, you will notice that /coins/bitcoin is being redirected to /coins/bitcoin/ with a trailing slash (the trailing slash is an important distinction between the URLs). This is part of "url normalization" and is something that's common for hosting to do. It's unrelated to your www redirect. The best way to fix this, in my opinion, ...


9

This is a design limitation: The file size must be between 1,000 and 10,000,000 bytes. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html Compressing files is resource-intensive, so the designers of CloudFront placed an upper bound on the size of files that CloudFront will spend resources compressing on-...


7

So, the solution seems to be that Amazon cloudfront also evaluates my robots.txt and somehow uses different syntax rules from google. The working version of my robots.txt is the following: User-agent: Googlebot-Image Disallow: / User-agent: * Disallow: /homepage Disallow: /uncategorized Disallow: /page Disallow: /category Disallow: /author Disallow: /feed ...


6

will browsers recognize individual files as being the same as pre-cached ones, if they are served from different subdomains? No. Two identical files served from different locations are different files as far as the browser (cache) is concerned. The URL is the key by which the file is cached by the browser. As media1, media2 etc all serve the same files, ...


5

Official docs says You can’t configure CloudFront to add any of the following headers to requests that it sends to your origin: Cache-Control Connection Content-Length Cookie Host If-Match If-Modified-Since If-None-Match If-Range If-Unmodified-Since Max-Forwards Pragma Proxy-Authorization Proxy-Connection Range Request-Range TE Trailer ...


4

My issue was because my CloudFront origin was not in us-east, and when you auto-select your bucket's origin in CloudFront, it doesn't add the location prefix to the url. So make sure you add your s3 location like so: bucketname.s3.ap-east-1.amazonaws.com


3

If an attacker is able to put themselves between your origin server and CloudFront edge location - it won't be so difficult for the attacker to capture your HTTP traffic and extract your information. Theoretically, it can be done on the side of your ISP. It is called as a "Man-in-the-middle" attack: https://en.wikipedia.org/wiki/Man-in-the-middle_attack If ...


3

I guess, the better, more scalable approach is to find out what system your client is using, and educate that network engineer. But if you really need a static IP to serve for Cloudfront content for your really important client, and if a different subdomain is acceptable to you, you could set up a proxy on your side for him. That said, you will lose the ...


3

The greatest benefit I derive from StackExchange is that asking the question forces me to state the problem in detail. In this case, I through in the parenthetical “(Cloudfront)” solely for completeness, but then I thought, “Hey...” Yes, turns out, when I set up the Cloudfront distribution for www (weeks ago) I specified the “alternative CNAME”, as “*....


3

No, you can't change it. it has a random name like that for security reasons also. Why do you need to remember that ID/URL? If you just do not want to see them, you can hide it. You can hide domain names by uncheck it from settings like the below image. For ID, you need the browser extension to find and hide its element. But I don't know why do you headache ...


2

There are several advantages of using your own domain for a CDN: You have full control over it, and can switch CDN providers more easily while retaining the same URLs. The domain can contain keywords relevant to your site. For example if you sell widgets then widgetimages.com is a good domain to use. If you use a subdomain, the images are now related to ...


2

Are you having the content on the CDN accessed by using the jr27a8vopf32a.cloudfront.net host name? The usual way is to not expose the cloudfront server name, but add a CNAME entry to your DNS to point requests for CDN content to something like media.mysite.com media.mysite.com CNAME jr27a8vopf32a.cloudfront.net Cloudfront is notified of this CNAME ...


2

The problem was that although I modified the search.widget.com CNAME to point to drvevtora80lk.cloudfront.net I forgot to add search.widget.com as an alternate name within my CloudFront distribution, added that and it now works.


2

Solved it! My assets.example.com CloudFront distribution needed a robots.txt file after all. After adding one following these instructions, googlebot is able to fetch & render my static assets successfully. It no longer reports them as Temporarily unreachable, and instead shows Complete.


2

Create a robots.txt in a bucket. Create another origin for your cloudfront distribution. Set your bucket's priority higher then your website. Invalidate your site's robots.txt on Cloudfront. After doing the above, Google will read the sites robots.txt when crawling your site and will get to see the different robots.txt when following links from your cdn.


2

That is pretty much what I have done; Images on CDN with CNAME record. Verified the CDN domain in Google Webmasters. Using CDN urls in sitemap. Added sitemap listing in robots.txt as well as in Google Webmasters. No robots restriction on CDN domain. And Google is indexing my images just fine. If I search for site:mysitedomain.com on Google; all images ...


2

Copy the css code that is used in the page, and place it in-line in a style tag on the page. This forces the css, and there is no performance hit, and in some cases, it will run faster as there is no request routines for a css page. Also, the fonts need to be the standard fonts, or locally installed, but I prefer to use the standard fonts the browser ...


1

I was struggling a bit with owned SSL Certificate and custom settings, but the following article really helped a lot: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/tutorial-redirecting-dns-queries.html Just had to read with attention to details... 502 bad gateway can be thrown only if the target is not reachable. Double check the origin and ...


1

The solution is uploading a separate robots.txt file for CloudFront URL. This will not block the CloudFront URL but will keep it away from google search Create robots_cf.txt file that contains this text: User-agent: * Disallow: / Now add this rule to .htaccess file (say Cloudfront URL is aaabbbcccddd.cloudfront.net): RewriteCond %{HTTP_HOST} ^...


1

I have some experience running a video platform and finding out how hard it is to maximize rpm. Video sites aren't targeting any specific profitable niche. And so add networks have to display a general click through camain and hope that your traffic leads to sales. Though I do think you can get your rpm up much higher than the 2 cents. It may be difficult ...


1

My website is a static blog Since your site is static, it is an excellent candidate for s3_website, which will automatically gzip files locally before uploading, and will also handle setting the content-type and cache invalidation on CloudFront. It's a 'no-brainer' once you get it set up and I highly recommend it. It's also free and open-source. You need ...


1

You unfortunately do not provide the name involved so people can not really troubleshoot things except by throwing guesses. Here is my generic (not exhaustive and not all possible corner cases) quick but logical list of steps to execute in order to check for timeouts, and you should complete, in that order, each step successfully before going to the next ...


1

Double redirects are less efficient: The browser makes a GET request for each Each hostname (or subdomain) requires a separated DNS lookup. In your chain you will have: 3 GET requests Two DNS lookups (HTTP and HTTPS use the same DNS lookup for example.com) If it is convenient, it would be better to configure http:// www.example.com to redirect directly ...


1

Easy enough. CloudFront supports multiple origin servers, and uses path patterns to determine which origin server to forward the requests to... so multiple, independent backend systems, even systems that aren't inside AWS, can all "own" one or more paths under a single hostname, with one of them being the default and owning all the paths not explicitly ...


1

This code (in .htaccess) resolved the problem <IfModule mod_headers.c> Header set Access-Control-Allow-Origin "*" </IfModule>


1

Google should only return image results under Google image search. So if you search for site:example.com and click on the image search afterwards, it should just return your results. Google will index whatever is embedded in the page regardless of whether you're using a CDN or not, and so 'View Image' will display it on the CDN while 'Visit Page' will ...


1

Found out the problem: The CloudFront reads the robots.txt and prevents serving the content, but it parses some how different from what robots should, I guess. For instance, the following content on robots.txt: Disallow: */wp-contents/ Allow: */wp-contents/themes/ When Googlebot gets it itself, it indexes it; When CloudFront reads it, it doesn't consider ...


1

Google does not block external resources from being indexed via using a robots.txt in the root of the main site. Using a sub domain, a cdn or other is classed as an external domain therefor the only way to block the content is using a header response on the file served by the CDN itself, or by using a robots.txt on the cdn or sub domain. Using: #Google ...


1

I am said network engineer, well maybe not that specific one but just another example and I come up against this question all of the time... There are a number of firewalls out there that when at Enterprise scale, have issues with DNS based ACL's. There are Security and Performance Issues to be considered. Can you trust the DNS won't be subverted or ...


1

CloudFlare has an awesome feature that automatically injects the user's country into the request headers (and this works even on their free plan). You could then easily use a server side redirect to direct the visitor to the appropriate URL based on this header. I've been running CloudFlare on top of our site for a while and am loving it so far. https://...


Only top voted, non community-wiki answers of a minimum length are eligible