Domain Name Redirect – Namecheap + Cloudflare
Example for HowdyTees.com redirecting to TeePublic site.
ALERT: Do NOT use the below instructions when Domain name is on Namecheap and website is on Cloudlfare Pages.
Final setup (see Start here, below, for step-by-step)
Namecheap
- Continues to own/register
howdytees.com - Nameservers now point to Cloudflare
- Namecheap’s old URL Redirect is no longer doing the forwarding
Cloudflare domain and DNS
- Free plan
- DNS handles
@andwww(DNS A record) - Both point to
192.0.2.1(DNS A record) - Both are 🟠 Proxied (DNS A record)
- HTTPS is handled by Cloudflare
- Active 302 Redirect Rule
Cloudflare redirect rule summary that Cloudflare has the exact configuration we intended:
- Status: Active
- Rule: HowdyTees → TeePublic
- Match:
http*://*howdytees.com/* - Action: 302 redirect
Start here:
Cloudflare – Add Domain
Add domain name. Select free plan. Acquire Name Server (NS) records to add to domain name DNS on Namecheap.
Overview:
- Add the domain to Cloudflare.
- Create a proxied DNS record using
192.0.2.1. - Create a redirect rule to the destination.
- Cloudflare dashboard > Domains > Overview > click Add Domain button
- Under Add a site, choose Connect a domain
- Select a plan for howdytees.com: Choose Free plan
- Click Continue to activiation
- Change the proxied DNS record IP address to
192.0.2.1. for howdytees.com A record - Change the proxied DNS record IP address to
192.0.2.1. for www.howdytees.com A record - Note the Name Server (NS) records:
- fiona.ns.cloudflare.com
- mitch.ns.cloudflare.com
Namecheap – Add Name Server records
- Copy the Cloudflare Name Server (NS) records to: Namecheap > Domain > Nameservers > Custom DNS:
- fiona.ns.cloudflare.com
- mitch.ns.cloudflare.com
Cloudflare – Add Redirect Rule
- Cloudflare dashboard > Domains > Overview > click Domain name
- Rules (in left-hand menu) > Overview > Redirect to a new URL: Click Create from template
- Create new Single Redirect: add a Name: HowdyTees → https://www.teepublic.com/user/reidwalley/albums/179203-howdy-tees
- If incoming requests match…: choose Wildcard pattern
- Request URL: http*://*howdytees.com/* (By using the asterisk (*) character to create a pattern that can match many requests e.g. https://*.example.com/files/*)
- Target URL: https://www.teepublic.com/user/reidwalley/albums/179203-howdy-tees
- Status code: 302 – Temporary redirect
- Preserve query string: Off