301 and 302 in website redirection

1. Difference
  301 permanent redirect, 301 will transfer the original page weight to the redirect target website. As search engines crawl the new content, they also replace the old URL with the redirected URL. It is mainly used to change the domain name or direct the domain name without www to the domain name with www.
  302 temporary redirect. Search engines will crawl the new content and keep the old URL, because the server returns a 302 code, and the search engine considers the new URL to be temporary. 302 redirection is considered a cheating method by search engines, and excessive 302 temporary redirection on the site may lead to punishment by search engines, resulting in the site being downgraded. Affect the effect of seo, so try to use it sparingly. There are still cases of "302 hijacking" using external redirection of 302, that is, hijacking other people's content to their own pages to gain better authority.
 
2. Common examples
1. Take baidu.com as an example: the user enters the website address in the browser http://www.baidu.com/ or http://www.baidu.com/index.php , in fact, what he visits is the home page of the site; the user enters the website address in the browser, http://www.baidu.com/ or http://baidu.com/ the visit is still the home page of the website.
2. In some cases, we may need to move a file in the site to a new location or change the name of the file. At this time, the user may still enter the URL that was previously saved to access the webpage file, so we need to try our best to ensure that both the previous URL and the new URL can access the latest webpage content.
3. Suppose a link is 404 or k for some reason, because this page still has weight, and I want to import the weight to other pages of the website instead of the 404 page, so as to avoid waste.
 
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325207798&siteId=291194637