Skip to content
    Moz logo Menu open Menu close
    • Products
      • Moz Pro
      • Moz Pro Home
      • Moz Local
      • Moz Local Home
      • STAT
      • Moz API
      • Moz API Home
      • Compare SEO Products
      • Moz Data
    • Free SEO Tools
      • Domain Analysis
      • Keyword Explorer
      • Link Explorer
      • Competitive Research
      • MozBar
      • More Free SEO Tools
    • Learn SEO
      • Beginner's Guide to SEO
      • SEO Learning Center
      • Moz Academy
      • MozCon
      • Webinars, Whitepapers, & Guides
    • Blog
    • Why Moz
      • Digital Marketers
      • Agency Solutions
      • Enterprise Solutions
      • Small Business Solutions
      • The Moz Story
      • New Releases
    • Log in
    • Log out
    • Products
      • Moz Pro

        Your all-in-one suite of SEO essentials.

      • Moz Local

        Raise your local SEO visibility with complete local SEO management.

      • STAT

        SERP tracking and analytics for enterprise SEO experts.

      • Moz API

        Power your SEO with our index of over 44 trillion links.

      • Compare SEO Products

        See which Moz SEO solution best meets your business needs.

      • Moz Data

        Power your SEO strategy & AI models with custom data solutions.

      Let your business shine with Listings AI
      Moz Local

      Let your business shine with Listings AI

      Learn more
    • Free SEO Tools
      • Domain Analysis

        Get top competitive SEO metrics like DA, top pages and more.

      • Keyword Explorer

        Find traffic-driving keywords with our 1.25 billion+ keyword index.

      • Link Explorer

        Explore over 40 trillion links for powerful backlink data.

      • Competitive Research

        Uncover valuable insights on your organic search competitors.

      • MozBar

        See top SEO metrics for free as you browse the web.

      • More Free SEO Tools

        Explore all the free SEO tools Moz has to offer.

      NEW Keyword Suggestions by Topic
      Moz Pro

      NEW Keyword Suggestions by Topic

      Learn more
    • Learn SEO
      • Beginner's Guide to SEO

        The #1 most popular introduction to SEO, trusted by millions.

      • SEO Learning Center

        Broaden your knowledge with SEO resources for all skill levels.

      • On-Demand Webinars

        Learn modern SEO best practices from industry experts.

      • How-To Guides

        Step-by-step guides to search success from the authority on SEO.

      • Moz Academy

        Upskill and get certified with on-demand courses & certifications.

      • MozCon

        Save on Early Bird tickets and join us in London or New York City

      Unlock flexible pricing & new endpoints
      Moz API

      Unlock flexible pricing & new endpoints

      Find your plan
    • Blog
    • Why Moz
      • Digital Marketers

        Simplify SEO tasks to save time and grow your traffic.

      • Small Business Solutions

        Uncover insights to make smarter marketing decisions in less time.

      • Agency Solutions

        Earn & keep valuable clients with unparalleled data & insights.

      • Enterprise Solutions

        Gain a competitive edge in the ever-changing world of search.

      • The Moz Story

        Moz was the first & remains the most trusted SEO company.

      • New Releases

        Get the scoop on the latest and greatest from Moz.

      Surface actionable competitive intel
      New Feature

      Surface actionable competitive intel

      Learn More
    • Log in
      • Moz Pro
      • Moz Local
      • Moz Local Dashboard
      • Moz API
      • Moz API Dashboard
      • Moz Academy
    • Avatar
      • Moz Home
      • Notifications
      • Account & Billing
      • Manage Users
      • Community Profile
      • My Q&A
      • My Videos
      • Log Out

    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. Home
    2. SEO Tactics
    3. Intermediate & Advanced SEO
    4. Switching from Http to Https, but what about images and image link juice?

    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.

    Switching from Http to Https, but what about images and image link juice?

    Intermediate & Advanced SEO
    3
    3
    21931
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with question management privileges can see it.
    • Shawn124
      Shawn124 last edited by

      Hi Ya'll.

      I'm transitioning our http version website to https.  Important question:

      Do images have to have 301 redirects? If so, how and where?

      Please send me a link or explain best practices.

      Best,

      Shawn

      1 Reply Last reply Reply Quote 1
      • becole
        becole last edited by

        Shawn124, whenever you move from HTTP to HTTPs, you'll need to set up the 301 permanent redirects for pages on the site only. The other elements, such as images, JavaScript (if they're external files), and .CSS files will need to be changed only in the code so that they reference the new HTTPs URLs, and not HTTP.

        If you load an HTTP element (such as an image that uses the full URL in it's reference rather than the image filename only) on an HTTPs URL, then the browser will give you an error.  So generally you need to do two things:

        • set up 301 Permanent Redirect for the page URLs.

        • search the entire website for all references to HTTP and  change them to HTTPs (unless you're linking out to an external site).

        If the site is in WordPress, you can use the Search and Replace plugin to replace it all at once in the database.

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

          If you  301 redirect all HTTP URLs to HTTPS On the origin server,

          To Move the origin server  the HTTP to HTTPS On the origin server your redirects on your images will follow

          #1

          NGINX

          Add the following to your Nginx config.

          server {
          listen 80;
          server_name domain.com www.domain.com;
          return 301 https://domain.com$request_uri;
          }
          

          Apache

          Add the following to your .htaccess file.

          RewriteEngine On
          RewriteCond %{HTTPS} off
          RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
          

          (TOOL Apache htaccess to NGINX config tool https://winginx.com/en/htaccess)

          #2

          Search and replace the old HTTP:// URLs to New HTTPS://

          • http://mydomain.com to https://mydomain.com
          • http://www.mydomain.com to https://www.mydomain.com

          Use CLI or https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

          #3

          Alert Google that you are migrating to HTTPS https://www.google.com/webmasters/tools/home?hl=en

          You will have no issue with your images.

          Your link juice will flow as it did before because Google is no longer penalizing multiple redirects (So they SAY BUT don't over use redirects) keep them to a minimum, please.

          https://www.deepcrawl.com/knowledge/best-practice/the-zen-guide-to-https-configuration/

          https://www.deepcrawl.com/knowledge/best-practice/https-dilemma-security-seo/

          #4

          If on WordPress using proxy or just  have insecure content use

          Really Simple SSL:  https://wordpress.org/plugins/really-simple-ssl/

          Your insecure content is fixed by replacing all HTTP:// URLs with HTTPS://, except links to other external domains. Everything is done dynamically.

          If using a Photos on a WAF or Pull CDN   Force HTTPS
          Connections

          #5

          For example, if you're using a CloudFlare for Photos? You would use page rules to force a 301 redirect HTTPS

          https://tools.keycdn.com/curl see #9 in https://www.maxcdn.com/one/tutorial/edge-rules-recipes/

          https://support.cloudflare.com/hc/en-us/articles/200170536-How-do-I-redirect-all-visitors-to-HTTPS-SSL-

          #6

          301's will not lose link juice see:

          https://moz.com/blog/301-redirection-rules-for-seo

          #7

          Test using https://www.deepcrawl.com/ & or https://www.screamingfrog.co.uk/seo-spider/

          (For a larger picture of the image below about redirect rule changing and link juice click on this URL http://i.imgur.com/vqyT6gm.jpg )

          #8

          If still needing tips or help read below.

          **  _If so, how and where? _**

          Do images have to have 301 redirects? Yes

          Citing:

          http://searchengineland.com/http-https-seos-guide-securing-website-246940

          "Making the switch from HTTP to HTTPS

          1. Start with a test server. This is important because it lets you get everything right and test without screwing it up in real time. Even if you are doing the switch without a test server, there’s almost nothing you can do that you can’t recover from, but it’s still best practice to have a plan and have everything tested ahead of time.
          2. Crawl the current website so that you know the current state of the site and for comparison purposes.
          3. Read any documentation regarding your server or CDN for HTTPS. I run into lots of fun CDN issues, but it can also be straightforward.
          4. Get a security certificate and install on the server. This will vary depending on your hosting environment and server setup too much for me to go into details, but the process is usually well-documented.
          5. Update references in content. This can usually be done with a search-and-replace in the database. You’ll want to update all references to internal links to use HTTPS or relative paths.
          6. Update references in templates. Again, depending on how you deploy, this might be done with Git or simply Notepad++, but you’ll want to make sure references to scripts, images, links and so on are either using HTTPS or relative paths.
          7. Update canonical tags. Most CMS systems will take care of this for you when you make the switch, but double-check, because that’s not always the case.
          8. **Update hreflang tags **if your website uses them, or any other tags such as OG tags for that matter. Again, most CMS systems will take care of this, but it’s best to QA it just in case.
          9. Update any plugins/modules/add-ons to make sure nothing breaks and that nothing contains insecure content. I commonly see internal site search and forms missed.
          10. CMS-specific settings may need to be changed. For major CMS systems, these are usually well-documented in migration guides.
          11. Crawl the site to make sure you didn’t miss any links and nothing is broken. You can export any insecure content in one of the Screaming Frog reports if this is the crawler you are using.
          12. Make sure any external scripts that are called support HTTPS.
          13. Force HTTPS with redirects. This will depend on your server and configuration but is well-documented for Apache, Nginx, and IIS.
          14. Update old redirects currently in place (and while you’re at it, take back your lost links from redirects that haven’t been done over the years). I mentioned during the Q&A portion of the Technical SEO Panel at SMX West that I’ve never had a site drop in rankings or traffic when switching to HTTPS, and a lot of people questioned me on this. Due diligence on redirects and redirect, chains are likely the difference, as this is what I see messed up the most when troubleshooting migrations.
          15. Crawl the old URLs for any broken redirects or any redirect chains, which you can find in a report with Screaming Frog.
          16. **Update sitemaps **to use HTTPS versions of the URLs.
          17. **Update your robots.txt file **to include your new sitemap.
          18. Enable HSTS. This tells the browser always to use HTTPS, which eliminates a server-side check and makes your website load faster. This can also cause confusion at times, since the redirect will show as 307. It could have a 301 or a 302 behind it, though, and you may need to clear your browser cache to see which.
          19. Enable OCSP stapling. This enables a server to check if a security certificate is revoked instead of a browser, which keeps the browser from having to download or cross-reference with the issuing certificate authority.
          20. Add HTTP/2 support.
          21. Add the HTTPS version of your site to all the search engine versions of webmaster tools that you use and load the new sitemap with HTTPS to them. This is important, as I’ve seen traffic drops misdiagnosed because they saw the traffic in the HTTP profile drop, when the traffic in reality moved to the HTTPS profile. Another note for this is that you do not need to use the Change of Address Tool when switching from HTTP to HTTPS.
          22. Update your disavow file if you had one for the HTTPS version.
          23. Update your URL parameter settings if you had these configured.
          24. Go live!
          25. In your analytics platform, make sure you update the default URL if one is required to ensure that you are tracking HTTPS properly, and add notes about the change so that you know when it occurred for future reference.
          26. Update your social share counts. There’s a lot of gotchas to this, in that some of the networks will transfer the counts through their APIs, while others will not. There are already guides for this around if you are interested in keeping your share counts.
          27. Update any paid media, email or marketing automation campaigns to use the HTTPS versions of the URLs.
          28. Update any other tools such as A/B testing software, heat maps and keyword tracking to use the HTTPS versions of the URLs.
          29. Monitor everything during the migration and check, double-check and triple-check to make sure everything is going smoothly. There are so many places where things can go wrong, and it seems like there are usually several issues that come up in any switch to HTTPS.

          One question I’m often asked is if incoming links should be cleaned up. This is a tremendous amount of outreach and effort. If you have time, then sure; but most likely you’re busy with other things, and I don’t feel it’s necessary. However, you should update the links on any properties that you control, such as social profiles."

          **  you asked for the best links here are what you need**

          • https://yoast.com/dev-blog/move-website-https-ssl/
          • https://www.semrush.com/blog/how-to-survive-a-website-migration-semrushchat/?l=en
          • https://www.digitalocean.com/community/questions/how-to-redirect-all-traffic-to-https-non-www
          • https://moz.com/community/q/301-redirect-all-pictures-when-moving-to-a-new-site
          • Link juice

          ** examplesI have put a lot more below**

          1. https://www.digitalocean.com/community/questions/how-to-redirect-all-traffic-to-https-non-www
          2. https://kinsta.com/knowledgebase/redirect-http-to-https/
          3. https://bjornjohansen.no/redirect-to-https-with-nginx

          Unless you have to modify whatever system it is powering them, do you have a CDN? Or using something like AWS S3?

          If so your images should move with the rest of the site. If you're posting them on a content delivery network or an AWS S3 whatever it is you must redirect that as well.

          1. https://yoast.com/dev-blog/move-website-https-ssl/
          2. https://support.google.com/webmasters/answer/83106?hl=en&ref_topic=6029673
          3. **https://moz.com/learn/seo/redirection **
          4. https://moz.com/community/q/301-redirect-all-pictures-when-moving-to-a-new-site

          juice will not be lost long is you tell Google your moving the site see the URL below for how to redirect

          https://www.deepcrawl.com/knowledge/best-practice/managing-url-redirects-301-302-307-and-meta-refreshes/

          Some of the systems will have buttons where you'd just click HTTPS others will require you to put the code into the system. I have posted the code below for Nginx as well as Apache.

          Redirect from HTTP to https

          This last bit will help you tremendously when you’ve not updated every single link on your site yet. You can just add a straight server level redirect from HTTP to https. In NGINX, we do this by having two servers defined in our config, the “right” one; that listens on port 443 and a simple one that listens on port 80 (standard HTTP) and has just this:

          server {
          listen 80;
          server_name yoursite.com www.yoursite.com;
          return 301 https://yoursite.com$request_uri;
          }

          This seems to be the fastest way of doing this in NGINX, in Apache you’d do something like this:

          RewriteEngine On
          RewriteCond %{HTTPS} off
          RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

          • Tools
          • http://www.aleydasolis.com/htaccess-redirects-generator/nonwww-to-www/
          • https://yoast.com/research/permalink-helper.php
          • http://www.contentforest.com/seo-tools/url-redirect-generator
          • https://donatstudios.com/RewriteRule_Generator
          • http://www.rapidtables.com/web/tools/redirect-generator.htm

          How to force SSL with. htaccess

          If you want to force your entire website to go through https, you can add these rules to your .htaccess file:

          | |

          RewriteEngineOnRewriteCond%{SERVER_PORT}80RewriteRule^(.*)$https://yourdomain.com/$1 [R,L]

          |

          If your site is in a subfolder, use this code:

          | |

          RewriteEngineOnRewriteCond%{SERVER_PORT}80RewriteCond%{REQUEST_URI}folderRewriteRule^(.*)$https://yourdomain.com/folder/$1 [R,L]

          |

          Only replace yourdomain.com with your actual domain name.

          Test with

          • https://varvy.com/tools/redirects/
          • https://varvy.com/pagespeed/hsts.html
          • https://varvy.com/mobile/mobile-redirects.html
          • http://searchengineland.com/http-https-seos-guide-securing-website-246940

          Hope this helps,

          Thomas

          vqyT6gm.jpg

          1 Reply Last reply Reply Quote 3
          • 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


          Browse Questions

          Explore more categories

          • Moz Tools

            Chat with the community about the Moz tools.

          • SEO Tactics

            Discuss the SEO process with fellow marketers

          • Community

            Discuss industry events, jobs, and news!

          • Digital Marketing

            Chat about tactics outside of SEO

          • Research & Trends

            Dive into research and trends in the search industry.

          • Support

            Connect on product support and feature requests.

          • See all categories

          Related Questions

          • mirabile

            Image Audit: Getting a list of *ALL* Images on a Site?

            Hello! We are doing an image optimization audit, and are therefore trying to find a way to get a list of all images on a site.  Screaming Frog seems like a great place to start (as per this helpful article:  https://moz.com/ugc/how-to-perform-an-image-optimization-audit), but unfortunately, it doesn't include images in CSS.  😞 Does the community have any ideas for how we try to otherwise get list of images? Thanks in advance for any tips/advice.

            Intermediate & Advanced SEO | | mirabile
            0
          • seoanalytics

            Text over image

            Hello, I am creating an overlay on a image. Is it ok to write on this overlay in html or it is better to have the text not on a image for google and other search engines ? Thank you,

            Intermediate & Advanced SEO | | seoanalytics
            0
          • Easigrass

            Help with force redirect HTTP to HTTPS

            Hi, I'm unsure of where I should be putting the following code for one of my Wordpress websites so that they redirect all HTTP requests to HTTPS. RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] This is my current htaccess file: *missing

            Intermediate & Advanced SEO | | Easigrass
            0
          • lcourse

            What is best practice for "Sorting" URLs to prevent indexing and for best link juice ?

            We are now introducing 5 links in all our category pages for different sorting options of category listings.
            The site has about 100.000 pages and with this change the number of URLs may go up to over 350.000 pages.
            Until now google is indexing well our site but I would like to prevent the "sorting URLS" leading to less complete crawling of our core pages, especially since we are planning further huge expansion of pages soon. Apart from blocking the paramter in the search console (which did not really work well for me in the past to prevent indexing) what do you suggest to minimize indexing of these URLs also taking into consideration link juice optimization? On a technical level the sorting is implemented in a way that the whole page is reloaded, for which may be better options as well.

            Intermediate & Advanced SEO | | lcourse
            0
          • Malika1

            If Robots.txt have blocked an Image (Image URL) but the other page which can be indexed has this image, how is the image treated?

            Hi MOZers, This probably is a dumb question but I have a case where the robots.tags has an image url blocked but this image is used on a page (lets call it Page A) which can be indexed. If the image on Page A has an Alt tags, then how is this information digested by crawlers? A) would Google totally ignore the image and the ALT tags information? OR B) Google would consider the ALT tags information? I am asking this because all the images on the website are blocked by robots.txt at the moment but I would really like website crawlers to crawl the alt tags information. Chances are that I will ask the webmaster to allow indexing of images too but I would like to understand what's happening currently. Looking forward to all your responses 🙂 Malika

            Intermediate & Advanced SEO | | Malika1
            1
          • MiguelSalcido

            Linking to URLs With Hash (#) in Them

            How does link juice flow when linking to URLs with the hash tag in them? If I link to this page, which generates a pop-over on my homepage that gives info about my special offer, where will the link juice go to? homepage.com/#specialoffer Will the link juice go to the homepage? Will it go nowhere? Will it go to the hash URL above? I'd like to publish an annual/evergreen sort of offer that will generate lots of links. And instead of driving those links to homepage.com/offer, I was hoping to get that link juice to flow to the homepage, or maybe even a product page, instead. And just updating the pop over information each year as the offer changes. I've seen competitors do it this way but wanted to see what the community here things in terms of linking to URLs with the hash tag in them. Can also be a use case for using hash tags in URLs for tracking purposes maybe?

            Intermediate & Advanced SEO | | MiguelSalcido
            0
          • M_D_Golden_Peak

            Do 404 Pages from Broken Links Still Pass Link Equity?

            Hi everyone, I've searched the Q&A section, and also Google, for about the past hour and couldn't find a clear answer on this. When inbound links point to a page that no longer exists, thus producing a 404 Error Page, is link equity/domain authority lost? We are migrating a large eCommerce website and have hundreds of pages with little to no traffic that have legacy 301 redirects pointing to their URLs. I'm trying to decide how necessary it is to keep these redirects. I'm not concerned about the page authority of the pages with little traffic...I'm concerned about overall domain authority of the site since that certainly plays a role in how the site ranks overall in Google (especially pages with no links pointing to them...perfect example is Amazon...thousands of pages with no external links that rank #1 in Google for their product name). Anyone have a clear answer? Thanks!

            Intermediate & Advanced SEO | | M_D_Golden_Peak
            0
          • HD_Leona

            Blocking Pages Via Robots, Can Images On Those Pages Be Included In Image Search

            Hi! I have pages within my forum where visitors can upload photos.  When they upload photos they provide a simple statement about the photo but no real information about the image,definitely not enough for the page to be deemed worthy of being indexed.  The industry however is one that really leans on images and having the images in Google Image search is important to us. The url structure is like such:  domain.com/community/photos/~username~/picture111111.aspx I wish to block the whole folder from Googlebot to prevent these low quality pages from being added to Google's main SERP results.  This would be something like this: User-agent: googlebot Disallow: /community/photos/ Can  I disallow Googlebot specifically rather than just using User-agent:  * which would then allow googlebot-image to pick up the photos?  I plan on configuring a way to add meaningful alt attributes and image names to assist in visibility, but the actual act of blocking the pages and getting the images picked up... Is this possible? Thanks! Leona

            Intermediate & Advanced SEO | | HD_Leona
            0

          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 - 2025 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.