Note that there are some explanatory texts on larger screens.

plurals
  1. POCloudfront Custom Origin Is Causing Duplicate Content Issues
    text
    copied!<p>I am using CloudFront to serve images, css and js files for my website using the custom origin option with subdomains CNAMEd to my account. It works pretty well. </p> <p>Main site: www.mainsite.com</p> <ol> <li>static1.mainsite.com</li> <li>static2.mainsite.com</li> </ol> <p>Sample page: www.mainsite.com/summary/page1.htm</p> <p>This page calls an image from static1.mainsite.com/images/image1.jpg</p> <p>If Cloudfront has not already cached the image, it gets the image from www.mainsite.htm/images/image1.jpg</p> <p>This all works fine.</p> <p>The problem is that google alert has reported the page as being found at both:</p> <ul> <li><a href="http://www.mainsite.com/summary/page1.htm">http://www.mainsite.com/summary/page1.htm</a></li> <li><a href="http://static1.mainsite.com/summary/page1.htm">http://static1.mainsite.com/summary/page1.htm</a></li> </ul> <p>The page should only be accessible from the www. site. Pages should not be accessible from the CNAME domains.</p> <p>I have tried to put a mod rewrite in the .htaccess file and I have also tried to put a exit() in the main script file.</p> <p>But when Cloudfront does not find the static1 version of the file in its cache, it calls it from the main site and then caches it.</p> <p>Questions then are: </p> <pre><code>1. What am I missing here? 2. How do I prevent my site from serving pages instead of just static components to cloudfront? 3. How do I delete the pages from cloudfront? just let them expire? </code></pre> <p>Thanks for your help.</p> <p>Joe</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload