It is one of the most frustrating messages a web administrator can find in Google Search Console: **"Alternative page with proper canonical tag"** under the **Not Indexed** section. You check the page, and it loads fine. You check the canonical tag, and it seems to point to your domain. Why then is Google rejecting your pages?

On hosting platforms like Vercel and Netlify, this error is almost always caused by a silent, hidden mismatch between the hosting provider's domain redirect settings and the hardcoded canonical links in your HTML. In this article, I will explain exactly how this loop happens and show you how to fix it in minutes.

Understanding the www vs non-www Redirect

When you set up a custom domain on Vercel, you generally configure two domains: yourdomain.com and www.yourdomain.com. Vercel asks you to pick one as the **Primary Domain** and automatically redirects the other version to it using an HTTP 308 Permanent Redirect.

For example, if you set www.yourdomain.com as primary:

  • A user visits https://yourdomain.com/services.html.
  • Vercel intercepts the request and redirects it to https://www.yourdomain.com/services.html.

This is standard and excellent for avoiding duplicate content. But it sets up an indexing trap if your HTML templates aren't aligned.

How the Canonical Loop is Created

Google's crawlers check the HTML head of your pages for the canonical tag (e.g. <link rel="canonical" href="...">) to know which URL is the master version they should index.

Here is the exact sequence of events that triggers the GSC indexing error:

  1. Google crawls your forced primary domain: https://www.yourdomain.com/services.html.
  2. It reads the HTML code, but finds a canonical link pointing to the non-www version:
    <!-- Mismatched Canonical tag in HTML -->
    <link rel="canonical" href="https://yourdomain.com/services.html" />
  3. Google says: *"Ah, the owner tells us the real URL is the non-www version. Let's ignore this www URL and crawl the canonical version instead."*
  4. Google tries to request the non-www page: https://yourdomain.com/services.html.
  5. Vercel sees the non-www request and redirects Googlebot right back to https://www.yourdomain.com/services.html!
  6. Google gets redirected in a loop. Realizing the canonical points to a page that redirects back, Google decides **not to index either URL**, marking the www page as "Alternative page with proper canonical tag" (not indexed).
"If your server forces www, but your HTML canonical tags point to non-www (or vice versa), you have created a canonical loop. Google will refuse to index your subpages, leaving them hidden from search results."

The Step-by-Step Fix

To resolve this, you must audit and match your hosting settings to your HTML links. Here is how we fixed it for Curious Kaizer:

Step 1: Check your primary domain redirect

Run a curl command in your terminal to see which domain your server redirects to:

curl -IL https://yourdomain.com/

Check the location: header. If it redirects to https://www.yourdomain.com/, then **WWW is your primary domain** and must be used in all canonicals. If it returns 200 OK without redirects, then **non-WWW is your primary domain**.

Step 2: Update all HTML canonical tags

Once you verify the primary domain, open all HTML files on your site and ensure the canonical tags use the exact same prefix. If your primary domain uses WWW, update them accordingly:

<!-- Correct WWW-aligned Canonical link -->
<link rel="canonical" href="https://www.curiouskaizer.com/services.html" />

Step 3: Update XML Sitemaps and robots.txt

Google relies on your sitemap to locate pages. If your sitemap contains redirecting non-www URLs, Google will list those as "Page with redirect" errors. Update all sitemap link tags (<loc>) to include the primary www format, and update the sitemap location in your robots.txt file:

# robots.txt
Sitemap: https://www.yourdomain.com/sitemap.xml

Requesting a Recrawl

Google updates its index when it recrawls your pages. To speed up indexation after making the fix:

  1. Open **Google Search Console**.
  2. Paste your URL into the top search bar (URL Inspection tool).
  3. Click **Request Indexing**. Google will fetch the page, see that the crawled URL matches the canonical tag, and index your pages successfully!
Previous Story
Optimizing Database Schema to Reduce Supabase Storage by 80%