Home 301 Jump to avoid the dead loop method
Index.html, index.php, index.htm, index.shtml, default.asp are common site default suffixes. It is precisely because of this, the home page will often have two problems, this will not only make the site repeat the content, but also the weight of the home page.
For this problem, we first thought would be 301 jump . To index.php, for example, if you will http://www.yourdomainname.com/index.php301 jump to http://www.yourdomainname.com, spider crawling http://www.yourdomainname.com/index. Php, will naturally go to http://www.yourdomainname.com, and when it crawls http://www.yourdomainname.com, you need to retrieve the contents of index.php file, and then turn to http : //www.yourdomainname.com, which also produces an infinite loop.
So, how to solve this problem? We can try the following method.
1, copy the contents of index.php to another file, we assume that the file name is sitehome.php.
2, in the file root directory to create instructions Apache DirectoryIndex directive, set to sitehome.php. Note that it is not necessary to set this command at the entire server level, otherwise other folders with index.php as the default file will cause problems.
3, in the file root directory. Htaccess file put: DirectoryIndex sitehome.php.
4, delete the original index.php file, insert the following code
Since then, you can avoid the 301 jump after the infinite loop problem. Of course, if you use the CMS system, you also need to ensure that all the links within the site point to the normalized url (http://www.yourdomainname.com), if for some reason CMS began to point to http://www.yourdomainname.com /sitehome.php, then into the next round of the dead loop.
Comments
Post a Comment