301 Redirect Method Daquan and SEO site normalization, look good first accept

Source: Internet
Author: User

301 Redirect Method Daquan and URL normalization in SEO

Most Web sites now have some of the same content, but the URL (URL) is not the same duplicate content, these duplicate content for the search engine may be considered to be copied pages, copying Web pages, although not punished but because of the existence of multiple URLs scattered page weights, certainly unfavorable to its ranking. To solve this problem requires URL rule processing, url normalization (url canonicalization) is literally the search engine to pick the best URL URLs as a real URL process, through the URL normalization process to the best URL URLs to feedback to the search engine.

There are a lot of ways to address the normalization of URLs, we are now talking about using 301 redirect for Web address normalization.

What is 301 redirect?

301 Redirect (301 turn, 301 jump) is one of the status codes in the header information in the HTTP data stream that the server returns when the user or search engine sends a browse request to the Web server, indicating that the page is permanently transferred to another address. 301 for permanent transfer (permanently Moved), 301 redirect is the best way to search engine friendly after changing the address of a webpage. As long as it is not temporarily moved, it is recommended that 301来 be used as a forwarding address.

How to do 301 redirects?

Here are the methods I collected from the online 301 Redirect, basically all, if you have a new method, you are welcome to add!

1, IIS6 under 301 settings

Redirect to URL, virtual directory, Internet Information Services Manager, enter the destination URL you want to turn to, and select permanent redirection of resources.

2.301 redirect Code under ASP

<%@ language=vbscript%> <% response.status= "301 Moved Permanently" Response.AddHeader "location", "/HTTP/ Www.mydomain.com "%>

3, ASP. NET 301 REDIRECT Code

<script runat= "Server" > private void Page_Load (object sender, System.EventArgs e) {response.status = "301 Moved Per Manently "; Response.AddHeader ("Location", "http://www.mydomain.com"); } </script>

4.301 redirect Code under PHP

Header ("http/1.1 301 Moved permanently"); Header ("location:http://www.mydomain.com"); Exit ();

5.301 redirect Code under CGI Perl

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

6.301 redirect Code under JSP

<% response.setstatus (301); Response.setheader ("Location", "http://www.mydomain.com/"); Response.setheader ("Connection", "close"); %>

7, ColdFusion under the 301 redirect

<cfheader statuscode= "301" statustext= "Moved permanently" >
<cfheader name= "Location" value= "http://www.new-url.com" >

8, Apache under 301 redirect Code

To create the. htaccess file, enter the following (you need to turn on mod_rewrite):

1) Turn the domain name without www to the domain name with www

Options +followsymlinks rewriteengine on Rewritecond%{http_host} ^mydomain.cn [NC] rewriterule ^ (. *) $/HTTP/ www.mydomain.cn/$1 [l,r=301]

2) redirect to new domain

Options +followsymlinks rewriteengine on Rewriterule ^ (. *) $ http://www.mydomain.cn/$1 [l,r=301]

3) Use regular 301 redirect for pseudo-static

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

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

9, Apache under vhosts.conf configuration 301 redirect

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

<virtualhost *:80> ServerName www.mydomain.cn Documentroot/home/lesishu </VirtualHost>

<virtualhost *:80> ServerName mydomain.cn redirectmatch Permanent ^/(. *) http://www.mydomain.cn/$1 </ Virtualhost>

Of course Apache under 301 redirects in addition to the above 2 methods, there are other configuration methods and optional parameters, you are welcome to add.

After 301 redirects, how do we detect if the 301 redirects we do are correct, the following is the 301 redirect Detection tool.

http://www.webuildpages.com/seo-tools/header-checker/

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

Recently found that 301 redirect URLs will also be included in Baidu, and Baidu Webmaster Tools-External chain analysis, you can see the page all the links, are listed in the outside chain.

This address: http://www.cnblogs.com/atree/archive/2010/09/13/301-URL-Rewrite-SEO.html

Turn from: Heart-auberge's Baidu Space

Website: http://hi.baidu.com/heartauberge/blog/item/92a3020efa2b0dc17acbe102.html

301 Redirect Method Daquan and SEO site normalization, look good first accept

Related Article

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.