Add www redirect and optimize meta descriptions#7
Conversation
English (189→140 chars) and German (216→148 chars) meta descriptions exceeded the recommended 25-160 character range flagged by Bing Webmaster Tools. Shortened both while preserving key messaging. https://claude.ai/code/session_01JYvEvQLzzxbPgSif2Ly2fj
Bing Webmaster Tools shows https://www.bonuz.tech/en as "Not discovered" because the www subdomain isn't redirecting to the canonical non-www domain. Added a 301 permanent redirect from www.bonuz.tech to bonuz.tech in the Next.js middleware so search engines can properly discover and index the locale pages. https://claude.ai/code/session_01JYvEvQLzzxbPgSif2Ly2fj
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
PR Review: Add www redirect and optimize meta descriptions Overall this is a clean, focused PR with no major issues. middleware.ts - WWW Redirect The implementation is correct and follows the standard Next.js middleware pattern. Minor: port clearing. Clearing url.port unconditionally is correct for production (avoids duplicating a port already embedded in the host header). Worth noting that testing www-redirect locally (e.g. www.localhost:3000) will redirect to localhost without a port, breaking the local dev flow. Minor DX nit only. Consider HTTPS enforcement. The redirect preserves the original protocol, so http://www.example.com redirects to http://example.com (still HTTP). If HTTPS is already enforced at the infrastructure layer (Vercel domain settings, Cloudflare, load balancer) this is fine. If not, consider adding an HTTPS redirect here alongside the www redirect. Ordering is correct. The www check fires before locale detection, so www visitors are redirected immediately without unnecessary locale processing. lib/dictionaries - Meta Descriptions Clean content edits. The shortened English description (~133 chars) fits within Google's recommended ~160-char limit, improving on the previous ~170-char version. No issues. Summary
Action item: Confirm whether HTTPS redirect is handled at the infrastructure layer. If not, consider adding it alongside the www redirect in this middleware. |
Summary
This PR implements a canonical domain redirect and refines SEO meta descriptions across the application.
Key Changes
www.subdomain requests to the non-www canonical domain with a 301 permanent redirectImplementation Details
https://claude.ai/code/session_01JYvEvQLzzxbPgSif2Ly2fj