Talking about the key points of 301 permanent redirect Technology

Source: Internet
Author: User

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

Recently in the consultation process found that many netizens do not understand the meaning of 301 redirect. A lot of related tutorials on the Internet, but in view of the Novice's ability to understand the limited, I collected some information, trying to use the simplest words to say clearly, and combined with actual combat to do comments.

Let's say I have two URLs (different URLs, even a different URL), such as

Http://www.xxxx.net.cn and http://zzzz.net.cn are two different URLs.

Or, more obviously, http://www.zzzz.net.cn and my other station http://www.XXXX.net.cn

You know what this is about 301 redirects. Redirect is the way to point a Web site to B. 301 redirect is to indicate that the page is permanently removed. For example: If I redirect http://www.XXXX.net.cn301 to http://www.zzzz.net.cn, it means http://www.XXXX.net.cn page is permanently moved to http://www.zzzz.net.cn.

There is also a 302 redirect, which means that the page is temporarily removed and the example can be referenced above.

So what's the benefit of doing 301 redirects? Do not good to se unfriendly, resulting in not included, weight reduction. Do a good job for their own web page weight add force.

We often encounter in the actual operation of the situation:

1. The website domain name has changed. For example, I want to change http://www.XXXX.net.cn to http://www.zzzz.net.cn. But the site changed, afraid of a lot of SE included articles cannot open.

2. Dynamic page to optimize the static page. Because dynamic and static URLs are not the same, se can be judged differently even on pages with exactly the same content.

3. Domain name resolution when a number of domain names to a page. Like what

Http://www.xxxx.net.cn and http://xxxx.net.cn/

Two URLs point to a page, bad will cause the page down right.

If the above problem is not handled, it will be bad for SE. So engaged in SEO, urgent need to use the redirection technology to deal with. In many technologies, 301 permanent redirection is one of the safest ways to do it, and it's an ideal solution. and 302 temporary orientation and URL forwarding are undesirable.

So for the correct implementation of the 301 redirect, there are several ways for you to refer to:

1.apache Server adds 301 redirect instructions to the. htaccess file

The use of "mod_rewrite" technology, in the form of:

Rewriteengine on

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

2. For users who use UNIX network servers

Notify search engine through this instruction spider your site file is not under this address. This is a more common approach.

Form: Redirect 301/http://www.xxxx.net.cn

3. Complete the 301 redirect in the system administrator configuration area of the server software

For users who use the window network server

4. Bind/Local DNS

If you have permission to edit the local DNS records, you can resolve the problem by simply adding a record. If you do not have this permission, you can require the Web site hosting service to set up the DNS server accordingly.

DNS Server settings

To point Blog.williamlong.info to www.xxxx.net.cn, you only need to add an alias record in the DNS service, which can be written as: blog in CNAME www.xxxx.net.cn.

If you need to configure a large number of virtual domain names, you can write: * in CNAME www.xxxx.net.cn.

This redirects all Williamlong.info records that have not been set to the end of the www.xxxx.net.cn.

5. Implement 301 redirects with asp/php:

ASP:

Response.status= "Moved Permanently"

Response.AddHeader "Location", "http://www.xxxx.net.cn"

Response.End

PHP:

Header ("http/1.1 moved Permanently");

Header ("location:http://www.xxxx.net.cn");

Exit ();

Description: Add the code to the relevant page.

Simple reviews: For server users, use. htaccess is the most convenient. But especially in the domestic most netizens are using the virtual host, this time may use the fifth way: realizes 301 redirects with the asp/php. Users in the use of the time to replace my domain name you can.

References: http://www.williamlong.info/archives/484.html

Reprint please specify from: SEO laboratory http://www.seolabs.net.cn

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.