The Moz Q&A Forum

    • Forum
    • Questions
    • 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 Forum
    2. Categories
    3. Digital Marketing
    4. Web Design
    5. Why are there lots of 404s after setting up CDN?
    Moz Q&A is closed.

    After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

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

    Web Design
    6 3 1.4k
    • 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
      • stj
        stj @DirkC last edited by

        Thanks Dirk.. That sounds good.

        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
          • 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
            • 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
              • 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
                • 1 / 1
                • First post
                  Last post

                Got a burning SEO question?

                Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


                Start my free trial


                Explore more categories

                • Moz Tools

                  Chat with the community about the Moz tools.

                  Getting Started
                  Moz Pro
                  Moz Local
                  Moz Bar
                  API
                  What's New

                • SEO Tactics

                  Discuss the SEO process with fellow marketers

                  Content Development
                  Competitive Research
                  Keyword Research
                  Link Building
                  On-Page Optimization
                  Technical SEO
                  Reporting & Analytics
                  Intermediate & Advanced SEO
                  Image & Video Optimization
                  International SEO
                  Local SEO

                • Community

                  Discuss industry events, jobs, and news!

                  Moz Blog
                  Moz News
                  Industry News
                  Jobs and Opportunities
                  SEO Learn Center
                  Whiteboard Friday

                • Digital Marketing

                  Chat about tactics outside of SEO

                  Affiliate Marketing
                  Branding
                  Conversion Rate Optimization
                  Web Design
                  Paid Search Marketing
                  Social Media

                • Research & Trends

                  Dive into research and trends in the search industry.

                  SERP Trends
                  Search Behavior
                  Algorithm Updates
                  White Hat / Black Hat SEO
                  Other SEO Tools

                • Support

                  Connect on product support and feature requests.

                  Product Support
                  Feature Requests
                  Participate in User Research

                • See all categories

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

                • Is it better to redirect a url or set up a landing page for a new site?
                  Will_Craig
                  Will_Craig
                  0
                  2
                  4.4k

                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

                Looks like your connection to Moz was lost, please wait while we try to reconnect.