Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Incubator Q&A

Welcome to the staging ground for new communities! Each proposal has a description in the "Descriptions" category and a body of questions and answers in "Incubator Q&A". You can ask questions (and get answers, we hope!) right away, and start new proposals.

Are you here to participate in a specific proposal? Click on the proposal tag (with the dark outline) to see only posts about that proposal and not all of the others that are in progress. Tags are at the bottom of each post.

Post History

60%
+1 −0
Incubator Q&A How do I configure Cloudflare to redirect my alternate domain name with HTTPS support?

Cloudflare lets you add many domains and each will get their own free tier of service. Here is a screenshot of my Cloudflare account. Each of those domains is an alternate domain that has been co...

posted 1y ago by Stephen Ostermiller‭  ·  edited 1y ago by Stephen Ostermiller‭

Answer
#3: Post edited by user avatar Stephen Ostermiller‭ · 2023-06-17T02:07:05Z (over 1 year ago)
  • Cloudflare lets you add many domains and each will get their own free tier of service. Here is a screenshot of my Cloudflare account. Each of those domains is an alternate domain that has been configured to redirect:
  • ![Cloudflare account websites](https://proposals.codidact.com/uploads/mnn6q4xlxhmh9fv24lkkxtmtcd9j)
  • After you add your domain to Cloudflare, you need to go into the DNS Records for that domain.
  • - Cloudflare will tell you two `NS` records. You need to log into your domain registrar and set these two values as the `NS` records for your domain within your domain registrar. This will establish Cloudflare as our DNS host for that domain.
  • - In Cloudflare, you need to add two `A` records for domain, one for the domain apex (no subdomain) and the other for the wildcard subdomain (`*`). The IP address you set for the origin server doesn't matter much, because Cloudflare itself will handle all requests for this domain. I use `1.1.1.1`. Both records need to be set as "Proxied" which sets them up to be served by Cloudflare's web servers.
  • ![Cloudflare DNS records for redirecting domains](https://proposals.codidact.com/uploads/5acwteh4tjptcfaeh0jt8x9xumrw)
  • Then you need to edit the "Page Rules" for the domain in Cloudflare. Create a rule to redirect `*alternate-domain.example/*` to `https://$1main-domain.example$2` or `https://main-domain.example/$2`. `$1` and `$2 are variables that correspond to the first and second wildcards (*) respectively. The variant with `$1` will preserve the subdomain with the redirect, and the version without the `$1` will remove the subdomain.
  • ![Cloudflare page rules for redirecting domain](https://proposals.codidact.com/uploads/ijd4zogjdqgmjtmtqljf9obk074t)
  • It may take a few hours for everything to settle:
  • - The `NS` records for your alternate domain need to propagate.
  • - Cloudflare needs to validate that you have changes your `NS` records to point to them.
  • - Cloudflare needs to create a TLS security certificate for your domain so that HTTPS traffic works.
  • All of those things should happen automatically. After a little while you should be able to visit `http://alternate-domain.example/` and `https://alternate-domain.example/` to get redirected to your main domain.
  • Cloudflare lets you add many domains and each will get their own free tier of service. Here is a screenshot of my Cloudflare account. Each of those domains is an alternate domain that has been configured to redirect:
  • ![Cloudflare account websites](https://proposals.codidact.com/uploads/mnn6q4xlxhmh9fv24lkkxtmtcd9j)
  • After you add your domain to Cloudflare, you need to go into the DNS Records for that domain.
  • - Cloudflare will tell you two `NS` records. You need to log into your domain registrar and set these two values as the `NS` records for your domain within your domain registrar. This will establish Cloudflare as our DNS host for that domain.
  • - In Cloudflare, you need to add two `A` records for domain, one for the domain apex (no subdomain) and the other for the wildcard subdomain (`*`). The IP address you set for the origin server doesn't matter much, because Cloudflare itself will handle all requests for this domain. I use `1.1.1.1`. Both records need to be set as "Proxied" which sets them up to be served by Cloudflare's web servers.
  • ![Cloudflare DNS records for redirecting domains](https://proposals.codidact.com/uploads/5acwteh4tjptcfaeh0jt8x9xumrw)
  • Then you need to edit the "Page Rules" for the domain in Cloudflare. Create a rule to redirect `*alternate-domain.example/*` to `https://$1main-domain.example$2` or `https://main-domain.example/$2`. `$1` and `$2 are variables that correspond to the first and second wildcards (*) respectively. The variant with `$1` will preserve the subdomain with the redirect, and the version without the `$1` will remove the subdomain.
  • ![Cloudflare page rules for redirecting domain](https://proposals.codidact.com/uploads/ijd4zogjdqgmjtmtqljf9obk074t)
  • It may take a few hours for everything to settle:
  • - The `NS` records for your alternate domain need to propagate.
  • - Cloudflare needs to validate that you have changed your `NS` records to point to them.
  • - Cloudflare needs to create a TLS security certificate for your domain so that HTTPS traffic works.
  • All of those things should happen automatically. After a little while you should be able to visit `http://alternate-domain.example/` and `https://alternate-domain.example/` to get redirected to your main domain.
#2: Post edited by user avatar Stephen Ostermiller‭ · 2023-06-17T02:03:21Z (over 1 year ago)
  • Cloudflare lets you add many domains and each will get their own free tier of service. Here is a screenshot of my Cloudflare account. Each of those domains is an alternate domain that has been configured to redirect:
  • ![Cloudflare account websites](https://proposals.codidact.com/uploads/mnn6q4xlxhmh9fv24lkkxtmtcd9j)
  • After you add your domain to Cloudflare, you need to go into the DNS Records for that domain.
  • - Cloudflare will tell you two `NS` records. You need to log into your domain registrar and set these two values as the `NS` records for your domain within your domain registrar. This will establish Cloudflare as our DNS host for that domain.
  • - In Cloudflare, you need to add two `A` records for domain, one for the domain apex (no subdomain) and the other for the wildcard subdomain (`*`). The IP address you set for the origin server doesn't matter much, because Cloudflare itself will handle all requests for this domain. I use `1.1.1.1`. Both records need to be set as "Proxied" which sets them up to be served by Cloudflare's web servers.
  • ![Cloudflare DNS records for redirecting domains](https://proposals.codidact.com/uploads/5acwteh4tjptcfaeh0jt8x9xumrw)
  • Then you need to into the Page Rules. Create a rules to redirect `*alternate-domain.example/*` to `https://$1main-domain.example$2` or `https://main-domain.example/$2`. `$1` and `$2 are variables that correspond to the first and second wildcards (*) respectively. The variant with `$1` will preserve the subdomain with the redirect, and the version without the `$1` will remove the subdomain.
  • ![Cloudflare page rules for redirecting domain](https://proposals.codidact.com/uploads/ijd4zogjdqgmjtmtqljf9obk074t)
  • It may take a few hours for everything to settle:
  • - The `NS` records for your alternate domain need to propagate.
  • - Cloudflare needs to validate that you have changes your `NS` records to point to them.
  • - Cloudflare needs to create a TLS security certificate for your domain so that HTTPS traffic works.
  • All of those things should happen automatically. After a little while you should be able to visit `http://alternate-domain.example/` and `https://alternate-domain.example/` to get redirected to your main domain.
  • Cloudflare lets you add many domains and each will get their own free tier of service. Here is a screenshot of my Cloudflare account. Each of those domains is an alternate domain that has been configured to redirect:
  • ![Cloudflare account websites](https://proposals.codidact.com/uploads/mnn6q4xlxhmh9fv24lkkxtmtcd9j)
  • After you add your domain to Cloudflare, you need to go into the DNS Records for that domain.
  • - Cloudflare will tell you two `NS` records. You need to log into your domain registrar and set these two values as the `NS` records for your domain within your domain registrar. This will establish Cloudflare as our DNS host for that domain.
  • - In Cloudflare, you need to add two `A` records for domain, one for the domain apex (no subdomain) and the other for the wildcard subdomain (`*`). The IP address you set for the origin server doesn't matter much, because Cloudflare itself will handle all requests for this domain. I use `1.1.1.1`. Both records need to be set as "Proxied" which sets them up to be served by Cloudflare's web servers.
  • ![Cloudflare DNS records for redirecting domains](https://proposals.codidact.com/uploads/5acwteh4tjptcfaeh0jt8x9xumrw)
  • Then you need to edit the "Page Rules" for the domain in Cloudflare. Create a rule to redirect `*alternate-domain.example/*` to `https://$1main-domain.example$2` or `https://main-domain.example/$2`. `$1` and `$2 are variables that correspond to the first and second wildcards (*) respectively. The variant with `$1` will preserve the subdomain with the redirect, and the version without the `$1` will remove the subdomain.
  • ![Cloudflare page rules for redirecting domain](https://proposals.codidact.com/uploads/ijd4zogjdqgmjtmtqljf9obk074t)
  • It may take a few hours for everything to settle:
  • - The `NS` records for your alternate domain need to propagate.
  • - Cloudflare needs to validate that you have changes your `NS` records to point to them.
  • - Cloudflare needs to create a TLS security certificate for your domain so that HTTPS traffic works.
  • All of those things should happen automatically. After a little while you should be able to visit `http://alternate-domain.example/` and `https://alternate-domain.example/` to get redirected to your main domain.
#1: Initial revision by user avatar Stephen Ostermiller‭ · 2023-06-17T02:02:06Z (over 1 year ago)
Cloudflare lets you add many domains and each will get their own free tier of service.  Here is a screenshot of my Cloudflare account.  Each of those domains is an alternate domain that has been configured to redirect:

![Cloudflare account websites](https://proposals.codidact.com/uploads/mnn6q4xlxhmh9fv24lkkxtmtcd9j)

After you add your domain to Cloudflare, you need to go into the DNS Records for that domain.

 - Cloudflare will tell you two `NS` records.  You need to log into your domain registrar and set these two values as the `NS` records for your domain within your domain registrar.  This will establish Cloudflare as our DNS host for that domain.
 - In Cloudflare, you need to add two `A` records for domain, one for the domain apex (no subdomain) and the other for the wildcard subdomain (`*`).  The IP address you set for the origin server doesn't matter much, because Cloudflare itself will handle all requests for this domain.  I use `1.1.1.1`. Both records need to be set as "Proxied" which sets them up to be served by Cloudflare's web servers.

![Cloudflare DNS records for redirecting domains](https://proposals.codidact.com/uploads/5acwteh4tjptcfaeh0jt8x9xumrw)

Then you need to into the Page Rules.  Create a rules to redirect `*alternate-domain.example/*` to `https://$1main-domain.example$2` or `https://main-domain.example/$2`.  `$1` and `$2 are variables that correspond to the first and second wildcards (*) respectively.  The variant with `$1` will preserve the subdomain with the redirect, and the version without the `$1` will remove the subdomain.

![Cloudflare page rules for redirecting domain](https://proposals.codidact.com/uploads/ijd4zogjdqgmjtmtqljf9obk074t)

It may take a few hours for everything to settle:

 - The `NS` records for your alternate domain need to propagate.
 - Cloudflare needs to validate that you have changes your `NS` records to point to them.
 - Cloudflare needs to create a TLS security certificate for your domain so that HTTPS traffic works.

All of those things should happen automatically. After a little while you should be able to visit `http://alternate-domain.example/` and `https://alternate-domain.example/` to get redirected to your main domain.