Today, I ran a website check on WebsiteGrader [website SEO scoring, SEO evaluation, SEO scoring tool], and the SEO score was only 64 points. The website provided some suggestions, one of which included implementing a 301 redirect. So, I searched online for "how to do a 301 redirect" and found a multitude of search results, but they were all essentially variations of the same version—copied from one site and slightly modified, with the original author now unknown.
Unfortunately, many people made small mistakes during the copying process and didn't notice them. After searching for a long time, I found the following version, which seems to be the original. If you also need to implement a 301 redirect, I hope the article below will serve as a useful reference for you.