2 months ago
I use Namecheap and would like to redirect www.domain.com to domain.com
There's a way shown in the below thread on how to do it via code. (I'm also using next.js for this project)
I would like to know If there any better way to do it rather doing it in my code
Would using CloudFlare Dns help me in this case ?
Related threads
https://station.railway.com/questions/redirect-www-to-root-domain-c9c3cf09
https://station.railway.com/questions/i-would-like-to-setup-a-www-redirect-to-d883ff50
2 Replies
2 months ago
We don't have a Namecheap-specific guide for www-to-root redirects because Namecheap doesn't offer built-in redirect rules the way Cloudflare does. Using Cloudflare as your DNS provider (by pointing your Namecheap nameservers to Cloudflare) would let you follow our documented guide for redirecting www to root with Cloudflare Bulk Redirects, which handles the redirect at the DNS/CDN layer without any code changes.
Status changed to Awaiting User Response Railway • about 2 months ago
Status changed to Awaiting Railway Response Railway • about 2 months ago
Status changed to Open Railway • about 2 months ago
2 months ago
Yes, you can configure Cloudflare's routing rules to redirect all traffic going into www to @.
Status changed to Solved brody • about 2 months ago

