Skip to content

Fix apex→www canonicalization (sitemap 3XX) - #1

Open
PaulBurgEth wants to merge 3 commits into
mainfrom
fix/sitemap-www-canonical
Open

Fix apex→www canonicalization (sitemap 3XX)#1
PaulBurgEth wants to merge 3 commits into
mainfrom
fix/sitemap-www-canonical

Conversation

@PaulBurgEth

@PaulBurgEth PaulBurgEth commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Why

Ahrefs' 2026-06-04 crawl flagged a new error: 3XX redirect in sitemap — 3 URLs. Confirmed live: the apex host regenbazaar.com 308-redirects to www.regenbazaar.com, but the sitemap, robots.txt, and all page meta tags pointed at the apex. A sitemap (and rel=canonical) pointing at a redirecting URL hurts crawl efficiency and canonical signals.

https://regenbazaar.com/          => 308 -> https://www.regenbazaar.com/
https://regenbazaar.com/ngos      => 308 -> https://www.regenbazaar.com/ngos
https://regenbazaar.com/investors => 308 -> https://www.regenbazaar.com/investors

What changed

  • sitemap.xml: 3 <loc>www. host
  • robots.txt: Sitemap: line → www. host
  • index/ngos/investors.html: rel=canonical, og:url, og:image, twitter:imagewww. host (same apex→redirect mismatch — sibling fix)

Verified

All canonical www URLs (and the og-image asset) now return 200, no 308:

https://www.regenbazaar.com/           => 200
https://www.regenbazaar.com/ngos       => 200
https://www.regenbazaar.com/investors  => 200
https://www.regenbazaar.com/assets/og-image.jpg => 200

No apex (non-www) references remain in any served file.

After merge

Re-submit sitemap.xml in Google Search Console and re-crawl in Ahrefs to clear the error.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • SEO
    • Updated canonical URLs plus Open Graph and Twitter URL/image metadata to use the www subdomain across site pages.
    • Updated related Twitter text metadata where applicable.
  • Analytics
    • Added Google Analytics tracking to the investors, NGOs, and homepage via the standard gtag script.
  • Content
    • Refined investors page dMRV wording (“Standards‑aligned”) and removed an associated compatibility sentence.
  • Chores
    • Updated sitemap and robots.txt to reference the www host.
    • Expanded deployment ignore rules to exclude *.bak files.

All three sitemap <loc> URLs and the robots.txt Sitemap line used the
apex host, which 308-redirects to www — Ahrefs flagged this as
"3XX redirect in sitemap (3 URLs)". Also canonicalized rel=canonical,
og:url, og:image and twitter:image across index/ngos/investors, which
had the same apex→redirect mismatch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Google Analytics tracking is initialized across all pages with ID G-385NGNGD7J. Page metadata—canonical links and Open Graph/Twitter references—are normalized to www.regenbazaar.com. The investors page updates a dMRV feature label, and crawler discovery files and deployment ignore rules are synchronized to the normalized domain.

Changes

Domain Normalization and Analytics Setup

Layer / File(s) Summary
Google Analytics tracking initialization
index.html, investors.html, ngos.html
Each page adds a Google Analytics gtag initialization script that sets up window.dataLayer and configures tracking with ID G-385NGNGD7J.
Page metadata and content normalization
index.html, investors.html, ngos.html
Canonical links and Open Graph/Twitter URL and image metadata are updated to www.regenbazaar.com across all pages; investors.html also changes the dMRV feature label from "Standards-compatible" to "Standards-aligned" with related description text adjustment.
Crawler discovery and deployment configuration
robots.txt, sitemap.xml, .vercelignore
The sitemap directive in robots.txt and <loc> entries in sitemap.xml are updated to reference www.regenbazaar.com for the homepage, /ngos, and /investors; .vercelignore adds an ignore rule for \\*.bak files.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 I've tracked the hops with gtag so bright,
Rewired all URLs to the www site,
From robots to maps, each link's now aligned,
One copy tweak, one backup refined—
Domain's tidy, analytics right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and specifically summarizes the main change: fixing canonicalization by switching from apex domain to www subdomain, with the sitemap 3XX redirect issue as context.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sitemap-www-canonical

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

PaulBurgEth and others added 2 commits June 8, 2026 20:23
investors.html: drop unverifiable "designed to be compatible with their
emerging dMRV programs" and rename heading to "Standards-aligned"; keep the
defensible "same MRV logic as Verra/Gold Standard" statement.

.vercelignore: add *.bak so backup files are never published to production
(they are gitignored but were not vercelignored).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@investors.html`:
- Around line 7-15: The gtag('config', 'G-385NGNGD7J') call initializes
analytics tracking immediately without checking for user consent, which violates
privacy regulations in consent-required regions. Before the gtag('config') call,
add a gtag('consent', 'default', {...}) command to set the default consent state
to denied for analytics and ad_storage properties, ensuring no data is collected
until the user explicitly provides consent. This defers analytics collection
until after the user has made their consent decision, bringing the
implementation into compliance with consent-required regulations.

In `@ngos.html`:
- Around line 7-15: The GA configuration is being sent immediately on page load
without applying consent mode first, which violates consent-first principles.
Before the gtag('config', 'G-385NGNGD7J') call on line 14, add a gtag('consent',
'default', {...}) statement that sets analytics_storage to 'denied' to establish
a default denied consent state. Then, after obtaining actual user consent (from
a consent banner or preference center), update the consent state by calling
gtag('consent', 'update', {...}) with analytics_storage set to 'granted' to
enable GA tracking only when the user has explicitly consented.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4c935e41-990f-46af-9ef4-91ca6524cb82

📥 Commits

Reviewing files that changed from the base of the PR and between eadf50b and b655ad5.

📒 Files selected for processing (3)
  • index.html
  • investors.html
  • ngos.html
🚧 Files skipped from review as they are similar to previous changes (1)
  • index.html

Comment thread investors.html
Comment on lines +7 to +15
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-385NGNGD7J"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-385NGNGD7J');
</script>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Gate GA initialization behind consent mode before gtag('config').

Line 14 initializes tracking immediately. Add a default denied consent state first (and update it after user consent) to avoid pre-consent analytics collection in consent-required regions.

Suggested patch
     <!-- Google tag (gtag.js) -->
     <script async src="https://www.googletagmanager.com/gtag/js?id=G-385NGNGD7J"></script>
     <script>
       window.dataLayer = window.dataLayer || [];
       function gtag(){dataLayer.push(arguments);}
       gtag('js', new Date());
+      gtag('consent', 'default', {
+        ad_storage: 'denied',
+        analytics_storage: 'denied',
+        ad_user_data: 'denied',
+        ad_personalization: 'denied'
+      });

       gtag('config', 'G-385NGNGD7J');
     </script>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-385NGNGD7J"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-385NGNGD7J');
</script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-385NGNGD7J"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('consent', 'default', {
ad_storage: 'denied',
analytics_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied'
});
gtag('config', 'G-385NGNGD7J');
</script>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@investors.html` around lines 7 - 15, The gtag('config', 'G-385NGNGD7J') call
initializes analytics tracking immediately without checking for user consent,
which violates privacy regulations in consent-required regions. Before the
gtag('config') call, add a gtag('consent', 'default', {...}) command to set the
default consent state to denied for analytics and ad_storage properties,
ensuring no data is collected until the user explicitly provides consent. This
defers analytics collection until after the user has made their consent
decision, bringing the implementation into compliance with consent-required
regulations.

Comment thread ngos.html
Comment on lines +7 to +15
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-385NGNGD7J"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-385NGNGD7J');
</script>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Apply consent mode before GA config here as well.

Line 14 sends GA config on load. Mirror a default denied consent state before gtag('config', ...), then switch to granted only after consent.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ngos.html` around lines 7 - 15, The GA configuration is being sent
immediately on page load without applying consent mode first, which violates
consent-first principles. Before the gtag('config', 'G-385NGNGD7J') call on line
14, add a gtag('consent', 'default', {...}) statement that sets
analytics_storage to 'denied' to establish a default denied consent state. Then,
after obtaining actual user consent (from a consent banner or preference
center), update the consent state by calling gtag('consent', 'update', {...})
with analytics_storage set to 'granted' to enable GA tracking only when the user
has explicitly consented.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant