Skip to content
Nazmul Nikhil
Menu

Canonical From HTTPS to HTTP in Ahrefs: Fix This One First

Ahrefs flags HTTPS pages whose canonical points to HTTP. That asks Google to prefer the insecure version. Here's where it comes from and how to fix it.

Nazmul Nikhil

By

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

Published 3 min read
Canonical From HTTPS to HTTP in Ahrefs: Fix This One First
Photo: Honey Yanibel Minaya Cruz on Unsplash

In short

Ahrefs flags "Canonical from HTTPS to HTTP" when an HTTPS page has a canonical tag pointing to its HTTP version. Google generally prefers HTTPS as canonical, so this sends a conflicting signal toward the insecure URL. Change the canonical to HTTPS and redirect HTTP to HTTPS across the site.

Of the two HTTP/HTTPS canonical issues, this is the one that matters. Here your secure page tells search engines the insecure copy is the original.

Why it matters

Ahrefs points out that HTTPS is a ranking factor, so secure pages should be the canonical. Google also says some signals can push it toward HTTP even on an HTTPS site: invalid certificates, HTTPS-to-HTTP redirects, and HTTP URLs in sitemaps or hreflang. A canonical to HTTP adds to that pull.

Where it comes from

  • The site moved to HTTPS, but the CMS's base URL setting still says http.

  • Canonicals are hardcoded in a template from before the move.

  • A CDN or proxy handles SSL, and the app server behind it thinks requests arrive on HTTP, so it builds http:// canonicals.

Free SEO audit

Not sure which issues matter on your site?

I'll review your site and send you the fixes that matter most, in plain English.

Get my free audit →

How to fix it

  1. Change the canonical to the HTTPS URL. Usually that means fixing the setting that builds every canonical, not editing pages one by one.

  2. Add a site-wide 301 redirect from HTTP to HTTPS (see the HTTP to HTTPS article for the .htaccess rule).

  3. Update the sitemap, hreflang and internal links to HTTPS.

WordPress: set both addresses in Settings > General to https. Behind Cloudflare or another proxy, make sure WordPress detects HTTPS. Otherwise SEO plugins keep building http:// canonicals. A search-replace tool can fix old http:// links stored in the database.

Shopify, Webflow and Wix: these platforms serve HTTPS canonicals by default. An HTTP canonical almost always comes from custom head code or an app, so remove it.

Custom builds: set the site URL config to https. If the app runs behind a proxy, read the X-Forwarded-Proto header (Express: app.set('trust proxy', 1)) so the app knows the original request was HTTPS.

How to confirm the fix

View source on a few HTTPS pages and confirm the canonical starts with https://. Then use URL Inspection in Search Console on a key page to see which canonical Google has chosen after it recrawls.

A worked example

A WordPress site sits behind Cloudflare with "Flexible" SSL. Visitors connect to Cloudflare over HTTPS, but Cloudflare connects to the origin server over plain HTTP. WordPress sees an HTTP request and builds every canonical, sitemap URL and internal link as http://. The page in the browser is secure, but its canonical points to the insecure copy.

The lasting fix is end-to-end HTTPS: install a certificate on the origin and switch Cloudflare to "Full (strict)". Then set both WordPress addresses to https. Canonicals then come out correct without plugins or hacks.

Why this one matters more than the reverse

Issue What the signals say Risk
Canonical from HTTP to HTTPS "Prefer the secure copy" (correct) Low: it's a tidiness problem
Canonical from HTTPS to HTTP "Prefer the insecure copy" (wrong) Higher: it pulls Google toward the HTTP version

Common mistakes

  • Overriding the canonical in a plugin instead of fixing the base URL. The sitemap, Open Graph tags and internal links stay wrong.

  • Adding a redirect from https to http to "match" the canonical. Google treats HTTPS-to-HTTP redirects as a signal toward HTTP. Always go the other way.

  • Skipping the database cleanup. Old http:// image and link URLs inside post content also cause mixed-content warnings.

This guide isn't affiliated with or endorsed by Ahrefs.

Sources and references

TAGSAhrefs Site AuditCanonical from https to httpAhrefs canonical https to httpCanonical tag http
Nazmul Nikhil

About the author

Nazmul Nikhil

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

SEO and AI search consultant in Dhaka, Bangladesh, helping small and mid-size businesses in the USA, UK, Australia and Canada.

Need help with this?

Get it fixed with Technical SEO

I find the issues that cost you traffic and fix them, starting with the pages that matter most.

Keep reading

Related articles

All Site Audit Issues posts →

Get the next guide in your inbox

One email when a new SEO or AI search guide goes live.

Ready to grow?

Get a free audit of your website, or book a 30-minute call to talk through your goals.

Nazmul Hasan

Talk to Nazmul directly

Reply within 24h

WhatsApp +880 1682835118
nazmulnikhil@gmail.com