WordPress knowledge sharing

The Method of DNS POD Realizing Domain Name 301 Redirection

I wrote an article in front of Weieis blog Lnmp environment setting 301 redirection This article explains how wordpress programs and other php programs in the lnmp environment can redirect the domain name 301. In view of various VPS and different php environment packages on the network, the situation is very different. Some friends failed to follow the method of that article. At the same time, some friends don't understand how to resolve the domain name before 301 redirection, and how to set the resolution if the domain name has CDN acceleration? Then Lao Wei will improve and supplement it today DNSPOD implements domain name 301 redirection Related content of.

Selected explosives area
618 Zhongshenghui Click to view the purchase
Selected preferential activities Click to view the purchase
Tencent Cloud Preferential Products Zone Click to view the purchase
Cross border e-commerce store server Lightweight application server
Tencent Cloud Animal Palu Game Server Click to view the purchase
For more Tencent Cloud content, please see Tencent Cloud

Using DNSPOD to implement 301 redirection is much simpler than doing 301 redirection on the server. I saw that too many people on the Internet asked how to do the 301 domain name redirection under the Linux environment, and many of the answers were copied and pasted, without strict testing, so you will not succeed if you follow them. Lao Wei's tutorial is his own step by step, which is completely a record of the real situation.

The domestic common term "301 redirect" refers to the 301 redirect of the main domain name (that is, the domain name without www) to the www domain name, which also conforms to the browsing habits of Chinese people. According to the normal 301 redirection operation sequence, we first do the domain name resolution. The following describes how to operate in two cases.

1. The domain name will not be CDN accelerated. Take DNSPOD as an example, as shown in the following figure. If you do not use CDN acceleration, log in to the domain name resolution background, add a record, the host record is "@", the record type is "explicit URL", and the record value is your www domain name. Save it. Add another record: host record "www", record type "A record", record value "IP address of your VPS", and save it.

DNSPOD technically uses "explicit URL" to implement 301 redirection function. It does not need to go to the VPS server for setting, which saves a lot of operations. If you use DNSPOD, you have succeeded. Go to query the https status. Other domain name resolution platforms can go to help or ask customer service, or set the NS server of the domain name to DNSPOD, and then follow the above operation. Lao Wei also sent a work order inquiry on DNSPOD, and the engineer replied the same way.

2. CDN acceleration for domain names. You need to add a www domain name in the CDN website management background in advance, and the system will automatically assign you a CNAME address of the CDN, and paste this address into DNSPOD. Similarly, add two records to DNSPOD@ The record still points to the www domain name with an explicit URL; Www domain name Add CNAME to the address provided by your CDN website.

Like the above one, the work of DNSPOD is over. Then check whether the https status is 301 (sometimes the DNS server needs to cache for a certain period of time, but it may not find 301 immediately). If you have no problem, go to the CDN acceleration website management background and add the CDN acceleration related settings.

The advantages of using CDN are as follows:

1. If most of your visitors are in China, they will visit your website faster after using CDN;

2. In this era of DDOS flying everywhere, using CDN helps to improve the security of VPS servers.

Generally speaking, after using DNSPOD to resolve 301 redirection, you don't need to set 301 redirection on the VPS server, which also saves novice Xiaobai a troublesome setting process. You can easily implement 301 redirection in two simple steps on DNSPOD.

Like( one )
Article name: DNSPOD Method for Domain Name 301 Redirection
Article link: https://www.vpsss.net/1538.html
Copyright notice: The resources of this website are only for personal learning and exchange, and are not allowed to be reproduced and used for commercial purposes, otherwise, legal issues will be borne by yourself.
The copyright of the pictures belongs to their respective creators, and the picture watermark is for the purpose of preventing unscrupulous people from stealing the fruits of labor.