Seo optimization test on 301 redirection

Source: Internet
Author: User
Tags website hosting

"301 redirection" can also be called "permanent page transfer". From the perspective of the seo tutorial, "301 redirection" is the most effective way to redirect websites. When the domain name of a website changes, the search engine only indexes the new domain name, at the same time, all external links under the old domain name will be transferred to the new domain name. After this operation, the website rankings will not be affected due to changes in the Web site. Similarly, when you use the 301 permanent redirection command to direct multiple domain names to the primary domain of the website, the ranking of the website will not be negatively affected.

For the correct implementation of 301 redirection, there are several methods for your reference:

1. Add the 301 redirection command to the. htaccess file.

The "mod_rewrite" technology is used, for example:

Rewriteengine on

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

2. Applicable to users who use unix network servers

Use this command to notify the search engine spider that your site file is not under this address. This is a common method.

Shape: redirect 301/http://www.111cn.net/

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

Applicable to users who use Windows network servers

4. Bind/local dns

If you have the permission to edit and modify local dns records, you only need to add a record to solve this problem. If you do not have this permission, you can ask the website hosting service provider to set the dns server accordingly.

Dns server settings

To direct blog.111cn.net to www.111cn.net, you only need to add an alias record to the dns service and write it as a blog in cname www.leezisem.com.

If you need to configure a large number of virtual domain names, you can write them as: * in cname www.111cn.net

In this way, all unconfigured records ending with ***. com can be redirected to www.111cn.net.

5. Use asp or php to implement 301 redirection:

Asp:

Response. status = "301 moved permanently"

Response. addheader "location", "http://www.111cn.net /"

Response. end

Php:

Header ("http/1.1 301 moved permanently ");

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

Exit ();

 

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.