What is 301 redirection and 301 redirection?

Source: Internet
Author: User
Tags website server

Last time inWhat does URL mean and unified URL optimization?Talking about how to use unified URLs and optimized websites301 redirection. Now let's talk about "what is 301 redirection and how to do 301 redirection ", when can I use 301 redirection, 301 redirection detection, 301 redirection code, and possible 301 redirection problems.

1. What is301Redirection

The 301 redirection is a permanent redirection. When a user or search engine sends a browser request to our website, the website server returns the HTTP data stream, which is the header of the data stream) contains a status code. "301" indicates a status code that permanently transfers the webpage to another address. The best way to change the webpage address to be friendly to search engines is to perform 301 redirection. If you do not temporarily transfer a webpage or some webpages, we all think that 301 redirection is more appropriate.

To put it simply, 301 redirection is used to jump from a webpage to the desired webpage of our webmaster.

Ii. Under what circumstances should I do?301Redirection

  • If you want to change the domain name, you can perform 301 redirection to achieve the search engine-friendly effect on your webpage, such as PR and other data, which ensures stable traffic.
  • If you have multiple homepage URLs, that is, when visitors can reach the same webpage through different URLs, this is the case where PR and external links are scattered, you can perform 301 redirection to determine the unique homepage URL, and unify all the PR and external links of the URL.
  • If you want to delete some pages inside the website, you can use 301 redirection to redirect the website to the homepage.
  • If you have multiple domain names or different websites that need to direct to the same website, you can use 301 for permanent redirection.
  • If you want to merge two websites, make sure that the link pointing to the expired website is redirected to the correct webpage.

III,301How to Implement redirection

Simply put, we can start with WordPress and common websites around us and use the 301 redirection code.

LinuxHost301Redirection

A host supporting Apache can be directly created. htaccess files cannot be created locally. when using htaccess, you can create a TXT file and rename it to ". htaccess. There are many tutorials on how to perform 301 redirection on the internet, whether it is full-site redirection or single-page redirection. Of course, you can also choose to operate directly in the space background, there are also tutorials on the internet, just search for it.

1 none www301 redirection to www

Code that can be written to the. htaccess File

2. Redirect for the whole site 301

Options + followsymlinks
Rewriteengine on
Rewritecond % ^ abc.com [Nc]
Rewriterule ^ (. *) $ http://www.abc.com/#1 [L, r = 301]
Rewritecond % ^ www.abc.com [Nc]
Rewriterule ^ (. *) $ http://abc.org/1_1 [L, r = 301]

The other is in index. php under the root directory.

Header ("HTTP/1.1 301 moved permanently ");
Header ("Location: http://abc.org /");
Exit ();

ASPHost301Redirection

Add the following lines to the top of index. asp or default. asp:
The Code is as follows:

<%
Response. Status = "301 moved permanently"
Response. addheader "location", "www.abc.org"
Response. End
%>

Use plug-ins301Redirection

We recommend 301 redirection plug-ins for WordPress:

Dean's permalinks migration
Permalinks migration plugin
Redirection
Platinum Seo pack (SEO plug-in with 301 redirection)

IV,301Redirection detection tool

You can try to use the tool. The former is foreign, and the latter is domestic, which is easy to understand.

Http://www.seoconsultants.com/tools/headers

Http://www.ranknow.cn/tools/redirectcheck

V,301Redirection errors

As far as I am concerned, there are not many problems caused by 301 redirection errors, because 301 redirection is relatively simple compared with other problems, just in. insert the above 301 redirection code in the htaccess file. The following is my personal experience on 301 redirection:

In the space background of the cpanel panel, you upload. the htaccess file may disappear, or you upload a TXT file. after renaming, the file will disappear because ". "the file at the beginning is hidden. You need to select the correct option under" go "before entering the File Manager to display the file in the entire file library.

An error occurred after uploading the. htaccess file that has been filled in: the homepage of the website can be opened and can enter the background, but cannot open the internal page. That is to say, the article page cannot be opened and the following English is displayed:
Additionally, a 404 Not Found error was encountered while trying to use an errordocument to handle the request.
In this case, you can enter the background of the website-click Modify Fixed Link and click OK.

301 redirection can be used in critical scenarios, reducing unnecessary troubles.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.