Skip to content

Conversation

@AsserAyman
Copy link

@AsserAyman AsserAyman commented Oct 21, 2025

fixes #124

Summary by CodeRabbit

  • Chores
    • Simplified URL routing structure by removing the "/en" prefix from English language URLs. Added permanent redirects for previously indexed URLs to ensure seamless access to updated URL paths.

@vercel
Copy link
Contributor

vercel bot commented Oct 21, 2025

@AsserAyman is attempting to deploy a commit to the DigitalSeem's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 21, 2025

Walkthrough

The changes remove the "/en" locale prefix from the i18n routing configuration and introduce permanent redirects in the Next.js config to handle backward compatibility with legacy Google-indexed URLs containing the old "/en" prefix.

Changes

Cohort / File(s) Summary
Locale prefix removal
src/i18n/config.ts
Removes the en-US locale prefix mapping from routing configuration, eliminating the "/en" prefix from the locale setup.
Redirect rules for legacy URLs
next.config.ts
Adds two permanent redirects: /en/ and /en/:path*/:path* to maintain backward compatibility with old Google-indexed URLs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Both changes are straightforward configuration updates with consistent intent: deprecating the "/en" prefix while maintaining backward compatibility through redirects.

Poem

🐰 The "/en" prefix hops away,
Old URLs find their new way,
Redirects guide the lost and weary,
From indexed ghosts, both old and eerie,
A cleaner path, simpler than before! 🌿

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "redirect to base url on google indexed url" directly corresponds to the main objective of the changeset. The modifications add permanent redirects (/en -> / and /en/:path* -> /:path*) to address Google-indexed URLs, and also remove the en-US locale prefix from routing configuration. The title accurately captures this primary purpose of redirecting Google-indexed URLs to the base URL without unnecessary noise or vague terminology. A developer scanning the repository history would understand that this addresses a specific issue with Google-indexed URLs requiring redirect logic.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d6ef78c and c0043b0.

📒 Files selected for processing (2)
  • next.config.ts (1 hunks)
  • src/i18n/config.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • src/i18n/config.ts
🔇 Additional comments (1)
next.config.ts (1)

47-58: LGTM - Verification complete, code approved.

The redirect implementation is correct and well-structured. Verification confirms:

  • Query parameters: Next.js automatically preserves query parameters in server-side redirects—no additional handling needed.
  • Other locales: Only /en needed migration. The i18n config shows other locales (ar-SA, fa-IR, tr-TR, ur-PK, etc.) retain their prefixes, so no additional redirects required.
  • Codebase clean: No hardcoded /en/ paths found outside next.config.ts.
  • Locale detection: Not impacted; the app uses localeDetection: false and en-US has no prefix in the updated config.

Redirect order is appropriate (specific /en before wildcard /en/:path*), and permanent: true is correct for SEO.


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.

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.

Indexed URL by Google isn't working

1 participant