Use CloudFlare to perform domain name redirective

When the website changes the domain name, the domain name is often used to point to the new domain name, which is usually called: URL forwarding, is good at using the URL forward, very useful for SEO, because this The way can clearly inform the search engine and the website has been replaced from the old domain name to the new domain name.

There are two forms of URL forwarding, one is 301, one is 302.

301 Move Permanently is a Status Code in the HTTP protocol. It can be easily understood that the resource has been permanently changed, which typically sends an HTTP location to redirect to the correct new location.

Returns the 301 request code to jump by Google considers the best way to migrate the site address from HTTP to HTTPS.

302 MOVED TEMPORARILY is a status code in the HTTP protocol. It can be easily understood as the resource originally existent, but has been temporarily changed.

In detail, the 301 and 302 status code represents the redirection, that is, the browser will automatically jump to a new URL address after the status code returned by the server, this address can be obtained from the Location header of the response ( The effect of the user see is that the address A he entered is instant to another address B) – this is their common. Their differences are there. 301 Indicates that the resources of the old address A have been permanently moved in addition to (this resource is not accessible), the search engine also exchanges the old URL to the following URL after grabbing new content; 302 indicates the old address A Resources are still (still accessible), this redirection is only temporarily jumped from the old address A to address B, and the search engine will grab new content and save the old URL.

At present, the domain name redirective service provider is available, many are not easy to use, relatively, the domain name redirection provided by CloudFlare is better. The specific setting method is as follows:

Open the CloudFlare website, “Add Record” in the DNS, type A, name is a domain name address that you need to forward, the proxy status selection has been proxy, the IP address is casually filled in.

After that, in the Page Rules option, click “Create Page Rules”,

Fill in: Original domain name *, forwarding the URL, 301 permanently redirect, new domain name $ 1.

For example, the setting page for forwarding to is shown below.

After saving and deploying, you can enable the 301 redirection of the domain name.

For free users, you can set up three page rules in CloudFlare.