The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Web Design
    4. Why are there lots of 404s after setting up CDN?

    Why are there lots of 404s after setting up CDN?

    Web Design
    6 3 377
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • stj
      stj last edited by

      I just setup Cloudfront CDN through W3 Total Cache. Everything looks good but there is one problem that I have encountered:

      After activating the CDN none of the images are available at the older image URLs and they are throwing a 404 error.

      Let me give you an example for this:

      1. Before I setup the CDN, let's say an image was available at http://example.com/wp-content/uploads/2015/03/leap-of-faith.jpg

      2. After I setup the CDN, the image is available at http://cdn.example.com/wp-content/uploads/2015/03/leap-of-faith.jpg and the good part is the URLs in the blog posts where this image was attached is updated to reflect the above mentioned URL. But the problem is that when visit the older URL of the image (which is what Google has crawled earlier, I get a 404 error).

      Can you help me how to avoid this problem?

      Ravi C

      1 Reply Last reply Reply Quote 0
      • DirkC
        DirkC last edited by

        Hi,

        You could put a 301 redirect of the old image folder to the new location. The easiest alternative is to keep the images in both places for a while, until Google has indexed the new location (which can take a few weeks/months). Normally, if all the internal links have been updated, there should be no links to old location, so these images will disappear from the index and replaced by the ones in the new location. Once they are indexed on their new location, you can delete them in the old location

        rgds,

        Dirk

        stj 1 Reply Last reply Reply Quote 1
        • stj
          stj @DirkC last edited by

          Thanks for that reply Dirk.

          I think what you are referring to is quite applicable when the CDN is setup via using a S3 bucket. I followed the following guide to setup my CloudFront CDN:

          https://www.doitwithwp.com/set-up-w3-total-cache-with-amazon-cloudfront-cdn

          Here are the 2 problems that I'm facing currently:

          1. The images appear at multiple CDN locations - http://cdn5.sarkarilife.com/wp-content/uploads/2015/01/bank-awareness-gk-ibps-bank-exams.jpg as well as http://cdn1.sarkarilife.com/wp-content/uploads/2015/01/bank-awareness-gk-ibps-bank-exams.jpg .

          2. The same image is not available at the original location - http://sarkarilife.com/wp-content/uploads/2015/01/bank-awareness-gk-ibps-bank-exams.jpg

          Looking forward to your response.

          1 Reply Last reply Reply Quote 0
          • Mustansar
            Mustansar last edited by

            I would say you may look at the set up process of CDN may not be as per the required criteria. IF you just check it thoroughly you may be able to get rid of it.

            1 Reply Last reply Reply Quote 0
            • DirkC
              DirkC last edited by

              Hi,

              Do you get a lot of traffic coming through image search? Most of the images you use on the site seem to be stock images, so normally the % of image search traffic shouldn't be that big.

              If you receive limited or no search traffic from image search, you don't really have to do anything special. There 404 errors in WMT will disappear after a while & the new images will get indexed. Normally the 404's will have no impact on search traffic.

              If all CDN's contain all the images, you could always redirect the original image folder to one of the cdn's - but it not strictly necessary.

              rgds

              Dirk

              stj 1 Reply Last reply Reply Quote 1
              • stj
                stj @DirkC last edited by

                Thanks Dirk.. That sounds good.

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                • Increase in Soft 404s due to Custom 404 page?
                  evolvingSEO
                  evolvingSEO
                  0
                  2
                  87

                • Should Blog Category Archive URLs be Set to "No-Index" in Wordpress?
                  DanielFreedman
                  DanielFreedman
                  0
                  4
                  668

                • Lots of Listing Pages with Thin Content on Real Estate Web Site-Best to Set them to No-Index?
                  Kingalan1
                  Kingalan1
                  0
                  11
                  1.2k

                • New website put up and ALL my keywords fell a LOT!???
                  AndyMacLean
                  AndyMacLean
                  0
                  6
                  294

                • Setting a Preferred Domain
                  KeriMorgret
                  KeriMorgret
                  0
                  3
                  345

                • Thoughts on using a CDN?
                  spes123
                  spes123
                  1
                  9
                  563

                • Amazon s3 how do i use it as a cdn service
                  ClaireH-184886
                  ClaireH-184886
                  0
                  6
                  586

                • How to set up Wordpress on our Germany Host?
                  stefanok
                  stefanok
                  0
                  4
                  843

                Get started with Moz Pro!

                Unlock the power of advanced SEO tools and data-driven insights.

                Start my free trial
                Products
                • Moz Pro
                • Moz Local
                • Moz API
                • Moz Data
                • STAT
                • Product Updates
                Moz Solutions
                • SMB Solutions
                • Agency Solutions
                • Enterprise Solutions
                • Digital Marketers
                Free SEO Tools
                • Domain Authority Checker
                • Link Explorer
                • Keyword Explorer
                • Competitive Research
                • Brand Authority Checker
                • Local Citation Checker
                • MozBar Extension
                • MozCast
                Resources
                • Blog
                • SEO Learning Center
                • Help Hub
                • Beginner's Guide to SEO
                • How-to Guides
                • Moz Academy
                • API Docs
                About Moz
                • About
                • Team
                • Careers
                • Contact
                Why Moz
                • Case Studies
                • Testimonials
                Get Involved
                • Become an Affiliate
                • MozCon
                • Webinars
                • Practical Marketer Series
                • MozPod
                Connect with us

                Contact the Help team

                Join our newsletter
                Moz logo
                © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                • Accessibility
                • Terms of Use
                • Privacy