Locate the source of a problem
How to find broken links? You may use special software called Xeno, webmaster tools of Google service or do it manually. Naturally, the latter variant is the most complicated and time consuming one, first of all due to the fact that you will need to check all site links manually.
The easiest and most reliable way is checking your site for broken links with the help of specific online services. There are several resources: Free Link Checker, BLC, Link Tiger, Link Checer and Dead Link Checker.
What harm do broken links cause? Sometimes a web store admin adds a URL into indexation and after that removes the content on that page. But the URL remains indexed and leads to an error page or to a hosting provider default page. This irritates customers and search engines a lot, most customers who got to a non-existing page will never come back.
Also, suppose there is a comment option enabled in the store, and all comments are indexed. A customer included their site URL into the comment text and after some time that site stopped working and became unavailable on the web. But the broken link remains on your store page.
Another possible reason – you decided to change the site structure completely, removed unnecessary figures in the URL or moved product(s) into another category. In this case, there also may be broken links, however they are self-removed as soon as a search engine robot checks your store next time.
How to fight them?
First of all, you need to find them, then launch any of the online services listed above using their instructions and check your site. Then, all broken links that were found need to be 301 redirected to correct pages, so that all customers who click a ‘bad’ link are taken to an existing page.
How to setup redirection
- Go to System > Configuration;
- In ADVANCED group section click Index Management;
- Choose Index Options;
- Click ‘Update’ and configure indexation;
- Click ‘Save Config’.
Now launch redirection script. For this go to the root Magento directory and locate the installation catalog. Add the following code:
PHP-е shell/url_migration_to_1_13.php –
Add ‘thread_count’ into the next line, this parameter is chosen according to Magento flows being used. After successful launch you will be redirected to configured root catalog, insert this line:
PHP-е shell/indexer.php –reindexall
This will start REINDEX.
After Reindex is complete, add the following code:
rm -rf var/cache var/full_page_cache var/locks
During the first days after this the volume of visits on your site may significantly reduce because some links will be removed from Google indexation. But after the search engine robot checks your site again, the links will be replaced with the correct ones, so no need to worry. Moreover, SEO specialists have determined that Google will gladly give you more PR points if all categories on your site are configured correctly. If you want to create the site from the very beginning, you should choose the specialists for this work with the excellent Magento development experience.
If you have any problems with code implementation, you may contact GoMage Magento experts. If you know any more methods to check and remove broken links, please leave a comment to the article or on our forum http://magentoforum.com/.