banner
MACSITE

@MACSITE

兴趣是学习的动力,学习也能成为消遣!--你愁啥-ncs.fun

Solution for adding multiple domain names in xlog

Unable to add multiple domain names, can only take a detour#

Because mainland DNS requires filing for 301 redirection, as a blogger who is stingy, I definitely won't buy a server. So there's no way to file.

Reasons for needing multiple domain names to point to one website#

It's really annoying that you can't directly use 301. Because when testing websites, you don't know how many domain names to use, just like bloggers need
www.ncs.fun
mac.ncs.fun
These two domain names redirect to this blog, ncs.fun
And some articles are referenced, and it's very likely that the original domain name will result in a 404 error when jumping from elsewhere.
Not only xlog can be used, it depends on how you use it.
In order to achieve multiple domain names pointing to one website
The blogger has tried many foreign DNS resolutions, either not supporting 301 redirection or not supporting subdomains, which is very cumbersome.

Implementation method#

Finally, it was discovered that using cloudflare.com to publish pages can achieve page redirection and solve the problem of domain name redirection.
The principle is
Your domain name resolves to cloudflare
Cloudflare uses an HTML page to redirect to the target website.

Here's how to do it#

First, register a cloudflare.com account, it's very simple, supports Chinese, but it's a bit slow.
After logging in, find "Pages",

@0NYTCUK1R

Click on create project

0557VZZR30G8%LTM@(137
Click on upload directly

SLE2IMP923JBPI5

Choose a project name, then upload an HTML file, which is to create an index.html file and compress it into a zip format. Remember to add this code inside the file:

<meta http-equiv="refresh" content="0;url= https://www.ncs.fun/ ">

content=0, this 0 is 0 seconds, you can set it between 0-10

url= the final website address you want to redirect to, make sure it's accurate

Then upload and deploy, and a second-level domain name will be generated: xxx.pages.dev,
Then click on the project name to enter and click on the settings for custom domain.
Add your own domain name that will be redirected

A

According to the requirements, go to your domain name's DNS resolution, add a CNAME, and save it. It will take effect within 10 minutes.

This method can achieve seamless redirection of any page when accessing your domain name.
But it only provides 100,000 free request times per day,
If exceeded, additional fees will be charged.
I believe that if you can achieve more than 100,000 visits per day, you won't care about whether it's free or not.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.