ASP.NET Page Canonical Tag URL Protocol Changes Unexpectedly

Viewed 38

I need help with a weird problem. I have an .aspx page where I'm placing the canonical URL of the page like this:

<link rel="canonical" href="http://example.com/page.aspx" />

When I access the page via HTTP it displays exactly as expected, but when I access it via HTTPS, the text in the canonical href attribute changes to HTTPS. I don't want that, I want it just as I wrote it there HTTP

Is it possible that the .NET configuration does this? I don't find anything that could cause it. Is there a setting in IIS? Where should I look?

  • I've tried writing a custom text in the value of href and it displays the as expected both on HTTP and HTTPS
  • I've tried writing the https:// version in the href and it displays it as expected (https) both on HTTP and HTTPS
  • I've tried writing "//:link" (without the protocol) and it displays "//:link" on both HTTP and HTTPS

So to summarize the question, how do I get the canonical tag to display "http://" when I access it via HTTPS?

I've been banging my head on the walls for the last 2 days about this issue and can't figure it out.

Please help!

1 Answers

The answer is quoted from this article.

If a site uses HTTPS and you see that the version mentioned next to the specification is the HTTP protocol, the site will send a mixed message to Google that the HTTP version is the preferred version and should be in the index.

To change this, fix your canonical tags to point to the correct version of the page. You can update your WordPress and fix each tag manually or ask for help from a web expert. It is recommended that you read this dedicated guide on how to migrate from HTTP to HTTPS.

Related