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. Local Website Optimization
    4. Image URLs changed 3 times after using a CDN - How to Handle for SEO?

    Image URLs changed 3 times after using a CDN - How to Handle for SEO?

    Local Website Optimization
    6 2 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.
    • emerald
      emerald last edited by

      Hi Mozzers,
      Hoping for your advice on how to handle the SEO effects an image URL change, that changed 3 times, during the course of setting up a CDN over a month period, as follows:

      • (URL 1) - Original image URL before CDN:www.mydomain.com/images/abc.jpg
      • (URL 2) - First CDN URL (without CNAME alias - using WPEngine & their own CDN):
        username.net-dns.com/images/abc.jpg
      • (URL 3) - Second CDN URL (with CNAME alias - applied 3 weeks later):
        cdn.mydomain.com/images/abc.jpg

      When we changed to URL 2, our image rankings in the Moz Tool Pro Rankings dropped from 80% to 5% (the one with the little photo icons).

      So my questions for recovery are:

      • Do I need to add a 301 redirect/Canonical tag from the old image URL 1 & 2 to URL 3 or something else?
      • Do I need to change my image sitemap to use cdn.mydomain.com/images/abc.jpg instead of www.?

      Thanks in advance for your advice.

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

        You're on it. Redirecting to the new image source and submitting a new sitemap pointing to the URL 3 location for your images will be big steps in the right direction.  Be sure to follow the instructions here for your sitemap: https://support.google.com/webmasters/answer/178636 as well as reviewing image publishing guidelines: https://support.google.com/webmasters/answer/114016. Cheers!

        emerald 1 Reply Last reply Reply Quote 2
        • emerald
          emerald @RyanPurkey last edited by

          Hi Ryan,
          Thanks for your reply and advice. I've read the guidelines and will follow those. But I wonder if you can clarify an issue on implementing them that is not answered there:

          On my site the images in 'Backend' (edit/admin/code view) start with WWW.mydomain... and in 'Frontend' (actual published view in browser) they start with CDN.mydomain...

          So my question is, do I use the Backend or Frontend (www. or cdn.) for the URL in both image sitemaps and in 301 redirect final destination?

          My current sitemap for example seems to be using www rather than cdn. : http://www.bosphorusyacht.com/sitemap-image.xml

          Thanks for your help!

          RyanPurkey 1 Reply Last reply Reply Quote 0
          • RyanPurkey
            RyanPurkey @emerald last edited by

            Right. Not everything is going to be served from cdn. It's most likely setup for your images so your sitemap will still reside on www. Make sure to point to the front end files though as those are the publicly accessible ones.

            1 Reply Last reply Reply Quote 2
            • emerald
              emerald last edited by

              Hi Ryan,
              Thanks for your answer - Sorry I didn't mean about the URL for the location of the sitemap - I think my question wasn't clear - may I rephrase it:

              (1) Inside my image sitemap, the urls serve off the www. subdomain as bolded in the example below (not .cdn). I'm assuming this setup is correct as this was auto-generated by an Image Sitemap Generator - does the below image:loc look correct to you?

              <url><loc>http://www.bosphorusyacht.com/yachts/</loc>
              image:imageimage:lochttp://**WWW.**bosphorusyacht.com/wp-content/uploads/2010/09/istanbul-boat-rental.jpg</image:loc></image:image></url>

              (2) For a 301 image redirect would I set it up like this:

              Redirect 301 /wp-content/uploads/2010/09/istanbul-boat-rental.jpg
              http://**WWW.**bosphorusyacht.com/wp-content/uploads/2010/09/istanbul-boat-rental.jpg

              OR

              Redirect 301 /wp-content/uploads/2010/09/istanbul-boat-rental.jpg
              http://**CDN.**bosphorusyacht.com/wp-content/uploads/2010/09/istanbul-boat-rental.jpg

              OR

              How would I 301 this one?: username.net-dns.com/images/abc.jpg

              Hope you can advise one last time - thank you!

              RyanPurkey 1 Reply Last reply Reply Quote 0
              • RyanPurkey
                RyanPurkey @emerald last edited by

                Sorry I missed this follow-up earlier. Within the site map you'll want to change the http://WWW to http://CDN for these image files. The www version of your site, and the cdn server are on two different IPs / server. You want images to be serving from the CDN one.

                For 2, if you do use 301 redirection I'd recommend scripting it so that the script inspects whether or not it's an image file and then applies the cdn change. A pro in your area that works with REgex and htaccess will be able to guide you through that.

                The username.net-dns.com thing... That's not your server is it? You can't apply redirects on servers outside of your control.  Cheers!

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                • Which URL and rel=canonical structure to use for location based product inventory pages?
                  tdastru
                  tdastru
                  0
                  5
                  256

                • What Is The Best Strategy For Writing Image Alt Text For SEO?
                  Katarina-Borovska
                  Katarina-Borovska
                  0
                  3
                  958

                • How many SEO clients do you handle?
                  EGOL
                  EGOL
                  0
                  12
                  1.8k

                • Which URL structure should I use?
                  danwebman
                  danwebman
                  0
                  5
                  173

                • Can you, somehow, use dynamic number insertion on a click to call button (image)
                  Sean_Gutermuth
                  Sean_Gutermuth
                  0
                  5
                  282

                • Local Area SEO - Directions Page and Multiple Use of Direction pages
                  David-Kley
                  David-Kley
                  0
                  4
                  323

                • Should I use keywords in all my URLs?
                  JaneCopland
                  JaneCopland
                  0
                  4
                  227

                • Do more page links work against a Google SEO ranking when there is only 1 url that other sites will link to?
                  couponguy
                  couponguy
                  0
                  7
                  137

                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