Skip to content

chore(netlify): fix canonical redirect to point to custom domain#312

Open
itvi-1234 wants to merge 1 commit into
kmesh-net:mainfrom
itvi-1234:fix/netlify-canonical-redirect
Open

chore(netlify): fix canonical redirect to point to custom domain#312
itvi-1234 wants to merge 1 commit into
kmesh-net:mainfrom
itvi-1234:fix/netlify-canonical-redirect

Conversation

@itvi-1234
Copy link
Copy Markdown

Description

This PR resolves a backwards-redirect rule inside netlify.toml where our official premium custom domain (kmesh.net) was mapped to redirect/proxy to our Netlify staging subdomain (kmesh-net.netlify.app).

The Problem:

  1. Backward Redirection: Requests coming to the main official domain https://kmesh.net were routed internally via a 200 rewrite status to https://kmesh-net.netlify.app.
  2. SEO Duplicate Content Penalty: When a website serves identical contents across both its staging subdomain (*.netlify.app) and the official custom domain without a proper 301 canonical link consolidated mapping, Google and Bing indexers flag both domains for duplicate content. This splits our Domain Authority and organically de-ranks Kmesh in organic search results.

The Solution:

We reversed the redirection logic to follow the recommended industry standard for Netlify-deployed custom domains:

  • Rule reversed: Standard redirection is now set from the Netlify staging subdomain https://kmesh-net.netlify.app/* to the canonical domain https://kmesh.net/:splat.
  • Status code upgraded to 301: Swapped 200 (rewrite) to 301 (Permanent Redirect). This explicitly instructs search engine indexers that the staging subdomain has permanently shifted authority to the custom domain, consolidating all PageRank value.
  • Wildcard :splat support: Ensures any sub-route visited on the staging app (e.g. /docs/welcome) cleanly redirects to the corresponding sub-route on the official domain, preventing any potential 404 errors.
image

Copilot AI review requested due to automatic review settings May 18, 2026 04:40
@netlify
Copy link
Copy Markdown

netlify Bot commented May 18, 2026

Deploy Preview for kmesh-net ready!

Name Link
🔨 Latest commit 79b8b6d
🔍 Latest deploy log https://app.netlify.com/projects/kmesh-net/deploys/6a0a9977c89c1f00075ff72f
😎 Deploy Preview https://deploy-preview-312--kmesh-net.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kmesh-bot
Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nlgwcy for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the redirection configuration in netlify.toml to redirect traffic from the Netlify staging domain to the canonical kmesh.net domain using a 301 permanent redirect. A review comment suggests moving this redirect rule to the top of the file to ensure it is processed before other rules, which is necessary to correctly enforce the canonical domain and prevent SEO duplicate content issues.

Comment thread netlify.toml Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Netlify redirect configuration to ensure the Netlify staging subdomain (kmesh-net.netlify.app) permanently redirects to the canonical custom domain (kmesh.net) to avoid backwards redirects and reduce SEO duplicate-content risk.

Changes:

  • Reversed the canonical redirect to send kmesh-net.netlify.app/* traffic to kmesh.net/:splat.
  • Updated the redirect status from a rewrite (200) to a permanent redirect (301).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread netlify.toml Outdated
Signed-off-by: itvi-1234 <rjsumit71@gmail.com>
@itvi-1234 itvi-1234 force-pushed the fix/netlify-canonical-redirect branch from d85327c to 79b8b6d Compare May 18, 2026 04:45
@kmesh-bot kmesh-bot added size/S and removed size/XS labels May 18, 2026
@itvi-1234 itvi-1234 requested a review from Copilot May 18, 2026 04:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@itvi-1234
Copy link
Copy Markdown
Author

/cc @yashisrani
/cc @LiZhenCheng9527

@yashisrani
Copy link
Copy Markdown
Contributor

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants