A5 Optimization Group: Avoid error 301 orientation caused by calamities

Source: Internet
Author: User
Tags root directory

Unified URL standardization to the domain name redirection, is the website different domain name weight centralized processing ideal method. However, as a webmaster, do you know that the wrong 301 redirect will bring unnecessary calamities to the site? In fact, in the site optimization process has a lot of webmaster to 301 redirect all errors. such as: directed to 302, or wrong jump code mistaken for 301. How to correctly 301 redirect for the website? The A5 Optimization Group (http://seo.admin5.com) makes the following analysis:

One: HTTP status query

Many webmaster think: Unified URL standardization refers to a domain name to jump to another domain name, nothing more. So a variety of methods will be endless, to achieve the final purpose. But wrong is wrong in such a way of thinking, the unified URL standardization is not huangbuzelu to the website address to jump, some jump means is likely to bring fatal disaster for the site. However, regardless of the method of URL orientation, the webmaster has to do one thing: Check the HTTP status, show 301:

  

As shown above, the page after the jump code, the first thing to check is whether the status code is "301". If appear: 200, 302 and so on is a failure of the redirect, need to immediately amend!

Two: 302 on the right of redirection

Search engine has no specifications say 302 redirect after the site will encounter the right, but a lot of webmaster practice to come up with a problem: 302 redirect will be "Baidu" down right, although all is redirect, but finally the result is really diametrically thinking. So how do we look at this problem?

In fact, 301 redirects refer to permanent orientation, while 302 redirects are temporary redirects. 301 redirect There's nothing to say, but 302 redirects? Search engines can understand that if a site takes 302 redirects to another site because it is temporary, it may be possible to undo the orientation or even redirect it to another site at any time. This leads to a problem: search engine spiders to crawl without "www" content is actually indexed to the content with the "www" page. What caused the problem? Two different URL addresses, but produced the same content, the last site because of the wrong direction of the right to be down is taken for granted.

But 301 redirect is not so, the meaning of 301 redirect is: Permanent redirect, that is, to tell the search engine this page weight I completely do not want to pass to other sites, so will make the domain weight normal superposition. On the other hand, there are some do not understand the URL orientation problem webmaster, the site domain name arbitrary jump is also completely wrong, the result may be more than 302 temporary orientation is also serious. So how do you do the right 301 redirect? The following content continues to analyze:

three: How to correct 301 redirect

301 Redirect Method There are many, for this point casually Baidu search can see a bunch. But many webmasters may also know that the content is rarely practical. Because of the difference of system environment and language program, many directional ways are created, and the directional methods required by different environments are completely different. Here we offer only three kinds of directional methods, which apply to 301 redirects in most cases:

1, Linux\unix environment to establish ". htaccess", and then add the following content to upload.

Rewriteengine on

Rewritecond%{http_host} ^***.com [NC]

Rewriterule ^ (. *) $ http://www.***.com/$1 [l,r=301]

2, the Windows Host environment:

< configuration >

< System.webserve r>

< rewrite >

< rules >

< rule name= "WWW Redirect" stopprocessing= "true" >

< match url= ". *"/>

< conditions >

< add input= "{http_host}" pattern= "^***.****.com$"/>

</conditions >

< action type= "Redirect" Url= "http://www.*****.com/{r:0}"

Redirecttype= "Permanent"/>

</rule >

</rules >

</rewrite >

</system.webserver >

</configuration >

3, no system-differentiated 301 redirect

First you must support the subdomain binding, then build a file "301" under the root directory, then build a index.asp file. Then add the content to it such as:

<%@ language=vbscript% >

<%response.status= "Moved Permanently"

Response.AddHeader "Location", "seo.admin5.com"

% >

This is the A5 optimization team on the Site 301 permanent redirection of some ideas, and the correct direction of reliable methods. Avoid the webmaster Error 302 Redirect, 200 jump orientation, hereby share.



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.