301 Steering and Web site normalization

Source: Internet
Author: User
Keywords To

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

301 Turn (or call 301 Redirect, 301 jump) is one of the status codes in the header information (header) in the HTTP data stream returned by the server when the user or search engine sends a browse request to the Web server, indicating that this page is permanently transferred to another address.

Web site steering methods mainly include: 301 turn, 302 turn, JavaScript turn, php/asp/cgi turn, meta-refresh web meta refresh, etc. The 302 steering may have URL normalization issues. Other methods are commonly used cheating, of course, not to say that can not be properly used, the method itself is not wrong, but the cheater used more, the search engine for these suspicious turn are very sensitive. Why take the risk?

The required 301 steering codes have been sorted, collected and shared for review

1, IIS under 301 settings

Internet Information Services Manager-> virtual directory-> to a URL, enter the destination URL that needs to be redirected, and select Permanent redirect for resources.

2, ASP 301 Steering Code

3. ASP. NET 301 Steering Code

4, PHP under the 301 steering code

Header ("http/1.1 moved Permanently");

Header ("location:http://www.china491.cn/articles/301/");

Exit ();

5, CGI Perl 301 Steering Code

$q = new CGI;

Print $q->redirect ("http://www.new-url.com/");

6, JSP under the 301 steering code

7, Apache 301 Turn Code

Create a new. htaccess file and enter the following (you need to turn on mod_rewrite):

1 Change the domain name without www to the domain name with www

Options +followsymlinks

Rewriteengine on

Rewritecond%{http_host} ^china491.cn [NC]

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

2 Redirect to new domain

Options +followsymlinks

Rewriteengine on

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

3) using regular 301 steering to achieve pseudo static

Options +followsymlinks

Rewriteengine on

Rewriterule ^news-(. +) \.html$ news.php?id=$1

Turn news.php?id=123 Such an address to news-123.html

8, Apache lower vhosts.conf configuration 301 Turn

In order to achieve URL normalization, SEO will usually change the domain name without www to the WWW domain name, vhosts.conf is configured as:

  

ServerName www.china491.cn

documentroot/home/china491

ServerName china491.cn

Redirectmatch permanent ^/(. *) http://www.china491.cn/$1

Apache In addition to the above 2 methods, there are other configuration methods and optional parameters, it is recommended to read the Apache document.

301 Steering Condition Detection

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

http://www.internetofficer.com/seo-tool/redirect-check/

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.