Admin5 I believe everyone is familiar with it. From the first time I got on A5, I saw that A5 did not do 301, that is, 301 without www was replaced with www. For example, when A5 enters admin5.com, this domain name will appear. If we click on an article under this domain name, then all articles on this site will not have www hyperlinks. So how can a large website like A5 change the entire website with minimal changes?
1. The seriousness of not doing 301;
If a website does not do a good job of 301, there will be a lot of trouble. For example, there are four addresses like A5 pointing to the same article. See the following example:
http://www.admin5.com/plus/view.php?aid=371620
http://admin5.com/plus/view.php?aid=371620
http://www.admin5.com/article/20110827/371620.shtml
http://admin5.com/article/20110827/371620.shtml
The above four addresses all point to one of my previous contributions. I believe everyone knows the consequences. I have seen that rooibos on Webmaster.com blocks the plus folder. However, rooibos is a protocol and not a regulation. There are also examples: http://www.baidu.com/s?tn=baiduhome_pg&bs=www.admin5.com%2Fplus%2Fview.php%3Faid%3D&f=8&rsv_bp=1&wd=%CD%F5%D3%C0%CD%A8%A3 %BA%C9%EE%B6%C8%B7%D6%CE%F6%B4%B4%D2%DA%CD%F8SEO%B2%DF%C2%D4%A3%A8%D2%BB%A3%A9 +&n=2&inputT=703 This article is not mine. I just searched it on Baidu. The snapshot is from August 19th. From another aspect, it is proved that rooibos is a protocol, so the importance of 301 is reflected.
2. Make the home page 301;
< ? Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.admin5.com " );? >
This string of code is the 301 code of PHP, which can be inserted into the header of index.php, but this will have side problems. For example, if our server is configured with the default file as html, htm or shtml, then the index.html will be opened first. The php file will be ignored and will have no effect. If our server is configured to open php by default, for the sake of search engine friendliness, we want to open html every time, so we must jump to http://www.admin5 with 301. com/index.html , then a new problem breaks out, that is, an index.html file is opened every time, not the root directory of the website. In fact, we can directly change the suffix name of the generated html file to php. That php file is actually a static page that does not call any database. From a search perspective, any file without a ? sign can be said to be static. document. Therefore, here you only need to open php by default on the server. If it is a server, please see below (of course A5 must be a server). This paragraph is written for virtual host users who have a similar situation to A5.
3. Once the home page is ready, what should I do if people directly access the inside page?
What should I do if the user directly clicks on an internal page without www? This requires 301 for the entire site. Then the file without www is an shtml file. Shtml does not support 301. JavaScript? This is the client language. How to 301? ?So a new problem arises. At this time, the server must be configured and httpd.ini modified. Since the server type cannot be known, there is no way to write it down here, but it can provide ideas. The addresses seen above are all in common. There is a 371602 that is the same. This is the ID number of the article. The generated folder is the date of the day. Then 301 the dynamic ones and those without www to the address of www. This rule should not be difficult to write.
4. What work needs to be done to make 301 more perfect;
After doing 301, or just being a friend of 301 on the homepage, how can we let users and search engines only open www files every time? This is just a finishing work. We only need to modify the template file to add /xxx and ../plus /xxx, add the absolute address http://www.admin5.com in front of the first /, and write the same into the Include file. In this way, even if you only create a 301 user on the homepage, users and search engines cannot be imported to a place without www.
301 is actually quite simple. Half a month ago, I was convinced that Alimama did not have it. Now I have also made 301. Compared with Chinaz, the webmaster website, it does a better job and has always had it. It’s not that A5 is not good. After all, a big website doesn’t just do this every day. I aim to make A5 better and more professional. The article is original by Mingrui. Please keep http://www.xmztd.com for reprinting. Thank you all. Please let me know if there is anything incomplete.
Editor in charge: Chen Long Author Mingrui’s personal space