Domain Change Guide: Cloudflare, Vercel, and Clerk Considerations
Hello everyone, this is MaoMaoyu.You should see that the domain name of MaoMaoyu Top4 AI tool nest has changed.
Changing your website's domain can be a complex process, especially when you're using services like Cloudflare for CDN, Vercel for hosting, and Clerk for user authentication. This guide will walk you through the necessary steps and specific considerations for each platform to ensure a smooth transition.
General Steps
- 301 Redirects: Configure 301 redirects on your server to point the old domain to the new one. This is crucial for both SEO and user experience.
- DNS Updates: Update the A records for your new domain to point to your server's IP address.
- HTTPS Configuration: Generate SSL/TLS certificates for your new domain to ensure HTTPS is available.
- Google Search Console: Set your preferred domain in Google Search Console and monitor your website's ranking and traffic.
Cloudflare Considerations
- DNS Settings: Update DNS records for the new domain in Cloudflare.
- SSL/TLS Settings: Ensure your new domain uses HTTPS in Cloudflare settings.
- Page Rules: Update page rules as necessary to match the new domain configuration.
- Cache Purge: Clear the Cloudflare cache to ensure new content is loaded and not the old cached version.
Vercel Considerations
- Domain Configuration: Add the new domain in the Domains section of your Vercel project.
- Old Domain Redirects: Configure 301 redirects for the old domain to the new domain within your Vercel deployment settings.
- DNS Update: Make sure the DNS records for the new domain point to Vercel's servers.
Clerk Considerations
- Clerk Dashboard: Update the production domain in the Clerk Dashboard.
- Navigate to Domains and select the Danger tab.
- Click on Change domain to update your domain.
- Alternatively, you can use the Backend API for this change.
- Backend API Update:
- Use the following
curl
command (replaceYOUR_CLERK_SECRET_KEY
andYOUR_PROD_URL
):
curl -X POST -H "Authorization: Bearer YOUR_CLERK_SECRET_KEY" -H "Content-Type: application/json" -d "{ \"home_url\": \"YOUR_PROD_URL\" }" https://api.clerk.com/v1/instance/change_domain
- Use the following
- Update Publishable Key: After modifying the domain, Clerk will generate a new Publishable Key. You must update this key in your environment variables and redeploy your application.
- Social Connections: If using social login, update callback URLs in your social platform settings.
- JWT Templates: If using JWT templates, update the JWT issuer and JWKS Endpoint in your external JWT SSO service.
- Subdomain Settings:
- In Domains, select the Danger tab.
- Modify or delete your Subdomain as needed.
Important Notes
- Clerk's development environment domain cannot be changed.
Summary
Changing your website's domain is a delicate operation that requires careful configuration across multiple platforms. Always back up your data before making changes, and ensure each step is accurate. Special attention is needed for services like Cloudflare, Vercel, and Clerk, where specific settings must be updated according to their respective configurations. Failure to do so could lead to website inaccessibility or impact your SEO ranking.