PHP Class 301 redirect actual site webmaster SEO required

Source: Internet
Author: User
Keywords seo 301 redirect

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

301 redirect This function to achieve the original intention is to make the site domain name and space changes caused by minimizing the impact, if the website uses the new domain name and the space then needs to use 301 redirects to the new domain name, lets the website visitor be able The quickest familiar new website environment. 301 Orientation is permanent redirect, which is to tell the search engine that this page directly points to another page, and is permanent.

Of course in our search engine to do 301 redirect The main purpose is to the unity of the weight of the site, we all know that the site and the site is by "passing" to share the weight of the search engine. Here to some novice sweep a blind, a lot of people ask me some of the links to the question always ask the outside chain (external link) is more than will be dispersed site weight, I gave the answer is, not. It is because the weight of the site is passed to share, so there is no dispersion or division of the weight of the said, so as long as the normal range of non-cheating means to increase the site outside the chain (external links) or the chain (reverse link) way on the site without any harm. And we do 301 redirect from the search engine optimization point of view, is to let all the site domain name weights are passed to the same domain name, let the weight unified. Such weights point to a domain search engine will understand the site to do redirect domain name is the site's main domain name, and give the highest authority. Below we will be in combat Operation PHP website system 301 redirects.

Our goal in this actual combat is to enter www.xx.com or xx.com or other domain names that are resolved to the same site in the browser to www.xx.com automatically.

Here's how to do this:

The first step is to implement redirection through the following PHP code.

Create a new file named "do301.php" using the "notepad" program we have on every computer (the name can be defined by itself). Save the exit after entering the following code.

-------------------------------does not include this row------------------------------------

  

Header ("Location: [Url]http://www.sjz-banzheng.com/index.html[/url]");? >

-------------------------------does not include this row------------------------------------

Note that after the input code must be changed to the above link address to your site as the main domain name address, otherwise it will be directed to Shijiazhuang to do this site.

The second step, the do301.php file uploaded to the server space, the process as a webmaster everyone should be able to master, here do not do too much elaboration. However, it is important to note that the do301.php file must be uploaded to the root directory of the site.

The third step, the do301.php file is set as the default home page file, this step needs to be set up in the website Space Control Panel. If the purchase of server space is required through the server Space Control Panel and account password for landing, and then found in the "Modify the default home page" The words of the link or interface to modify, then you will see that there is an input box is everyone familiar with the file name, index.asp, Default.php and so on. Enter do301.php in the front of the input box. Don't forget to make sure you quit again.

The third step, the input of the site's domain name for testing, if the input of several resolution of the same domain name can be directed to the same domain name under the direction of success. If the change of domain name does not occur in the browser address bar, the orientation is not successful, then you need to check the PHP code you entered.

I believe you can see here will understand, do 301 redirect is to make the site unified weight, and can let everyone through the same domain name to find the site is more conducive to the promotion of the site and publicity. 301 redirect is a very simple and very practical optimization skills, I hope we can understand the essence and meaning, facing the increasingly fierce search engine today to master a method of adding points will make our work efficiency improve a lot. Finally, it is important to explain the role of the index.html static page in the example redirection, because the search engine gradually values the speed of the website, and the static page is the fastest one in the page file, so we redirect to the HTML page. This article copyright: www.bzw99.com reprint Please specify. You can also check this site to test the effect of 301 redirects, you can also search the keyword "Alipay" to see the extent of SEO.

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.