Home >Backend Development >PHP Tutorial >Detailed explanation of 301 usage and errors
If you are using a Windows host, you should make 301 redirect settings in the control panel. Editor's Choice: Introduction to php pseudo-static URL REWRITE rewriting rules php URL rewrite path rewriting example Supplement: Answering Stone King’s question in the URL standardization comment may be helpful to everyone: As far as I know, HTML cannot do 301 redirects. You can only do JS or META REFRESH in HTML, but not 301 redirects. As soon as the HTML is read, a 200 OK status code is returned. If your page is ASP or PHP, you can also do a 301 redirect: ASP:
PHP:
Also, The DOThtaccess file is just an ordinary text file. You use Notepad to create this file, put the instructions, and save it in the root directory of your account. No modifications to Apache are required. Question: How long does it take for search engines to process a web page after a 301 redirect? After the web page is redirected with 301, will the page with the old domain name indexed by the original search engine be forwarded to the new domain name it is directed to? What will happen to pages with old domain names indexed by search engines, for example? Will the content in the old domain name be transferred to the new domain name after site:www.xxx.com? How long will it take?A: If your old URL points to your new site using an HTTP 301 (permanent) redirect, search engines will automatically learn of the new URL as they roam and update it automatically within six to eight weeks.
301 redirect can promote search engine optimization effect From the perspective of search engine optimization, 301 redirection is the most feasible way to redirect URLs. When the domain name of a website changes, the search engine will only index the new URL, and at the same time, it will transfer all the original external links under the old address to the new address, so that the ranking of the website will not be affected due to the URL change. No impact at all. Similarly, when using the 301 permanent redirect command to point multiple domain names to the main domain of the website, it will not have any negative impact on the ranking of the website. |