Computing : Web Design  
Menu          Contact
     Avoid causing broken backlinks to your web pages in Search Engines, Web Directories or Forums, or in viewers' Bookmarks or Favorites     
              
  Websites change.  That's a must.  Otherwise they become boring and will not have any repeat visitors.  But managing those changes thoughtfully is of the utmost importance.  If you simply delete any of your hosted (i.e. online) files, or even move or rename them, the first consequence is that you are going to cause broken links all over the internet - in search engines and web directories, in forums, in people's bookmarks, on other web pages that have linked back to you, even in old computer magazines that may have mentioned pages within your site.

You will note here that we are talking about external links back to pages in your site.  We are not talking about the internal links within your site.  The latter ones are easily fixed.  In fact, most web design programs will alert you if you are about to break a local (internal) link - and can repair the (local) damage automatically.  But therein lies the danger.  Fixing a broken link on your site off-line is so simple and automatic that it often blinds even the best of webmasters to the fact that uploading the 'repaired' page(s) will, unwittingly, result in numerous external links back to the original online pages being immediately broken.  It is all too easy to forget, or deliberately disregard those backlinks because you never know where they are, nor how many there are.  But the danger is still there that, each time you move, delete or rename a page or folder, you could be breaking dozens of such links, possible hundreds, even thousands - all depending on how popular your own website is and how useful the page(s) with the now-defunct address had been.

Broken external backlinks are bad news for surfers - but are even worse news for you, as the webmaster or website owner, as you will be losing traffic that was trying to come to you.  In most cases, that traffic, unbeknown to you, will either be re-routed, by settings in the viewer's browser, often applied by invisible adware infecting the user's machine, to somebody else's totally unrelated junk menu-listing page or, just as bad, be blocked by a dead-end default, or purpose-made, "Error 404 : Page cannot be found" message (example).

As the example shows, it is not uncommon to find that even topflight professional webmasters fail to appreciate the disservice they will do to their visitors whenever they make even minor changes to the internal structure of a website.

Search engines and web directories can be profoundly inefficient and unsatisfactory in the differing ways with which they deal with any broken links you may have inadvertently caused them.  Some engines may continue to use an index with obsolete links pointing to non-existent pages for months on end.  Some will never bother to revise their index with any alternative or updated pages you may have uploaded or submitted.  While others will just drop you from their index altogether.  All these are, of course, totally undesirable scenarios which need to be avoided by webmasters at all costs if they are at all conscientious.

As for viewers who have made bookmarks to your now-defunct pages, when they try to come back to the page in the future, they will just see a junk-menu page or an error message.  In either event, they will delete the dead bookmark and that could be the last you will ever see of them!

If you believe you might have created any of these bad situations by moving, deleting or renaming any folders or pages on your own website(s), or you would simply like to know how to avoid it happening to you in the future, here is a simple method that will ensure broken external backlinks to your site, wherever on the internet they might be, will automatically be diverted to valid pages of your own choosing.  All it involves, basically, is putting a small file online, in the same location and with the same name as the defunct page.  The new page is designed to redirect followers of broken links to a suitable new page elsewhere within your site.

Options - The pastable code in Fig 1 includes the 'META Refresh' HTML tag.  This tag is not favoured by some webmasters due to fears about Back-button loops or some search engines possibly ignoring pages with the tag or banning the site.  Exactly which search engines are supposed to do that nobody has made clear.  However, in our experience, we can safely say that neither of the two search engines that really matter, i.e. Google and msnsearch.com, will ban a site that is not using the Refresh tag improperly or deviously.  That said, if, after you paste the text from Fig 1, you simply delete the whole META Refresh tag, the page will still serve its intended purpose of preventing the breaking of external backlinks to your site.  The difference being that it will do so as a visible, interactive, redirection page, instead of an invisible, automatic one. Alternatively, auto redirection can be achieved by a similar kind of page but with a small JavaScript in it instead of the META Refresh tag.  If that would interest you, see Tip 4 in the RH column.

1.  Use your mouse to highlight all the HTML code in Fig. 1 > press Ctrl+C to copy it to your clipboard > open Notepad on your PC > press Ctrl+V to paste the code into Notepad > click File > Save As > at the 'Save in' field, browse to and open the same off-line folder that your website's Home page is in > at 'File name', type in fixlinks.htm > at 'Save as type', choose 'All Files (*.*)' > Save.
2.  After you have saved the code from Fig 1 as "fixlinks.htm", look in the code you pasted into Notepad for the long URL that is split over two lines in the middle of the word "supanet".  Put the cursor after the letter 'n' in supanet and press the Del key.  This will join the split URL together so that it is in one single string with no line break in it.
  The file "fixlinks.htm" is a master page that is NOT intended to be uploaded.  You now make a COPY of it and rename the copy with the exact name of your defunct page.  If you have made, or are making more than one page defunct, make further copies of the master, naming each one after one of the other defunct pages.  You then move each such copy into the same off-line folder that once held, or still holds the corresponding defunct page.  If you have renamed or deleted a folder that a defunct page was in, recreate that folder too, giving it exactly the same name and relative location that it originally had.  After you have moved each renamed copy of fixlinks.htm into its relevant folder, open one of the moved pages, in Notepad, and look for the two occurrences of the address "http://www.xxxx.com".  Change the "www.xxxx.com" bit of both to the actual address of the valid page to which you would like any broken links pointing to the defunct page to be redirected e.g. http://www.sitename.com/foldername/pagename.htm.  Use the same address to replace both instances of www.xxxx.com.  Use an absolute address (i.e. http://...), not a relative address.  If you no longer have a page with similar content to the defunct page, use the address of your Home page in which case, "http://www.xxxx.com" would become something like "http://www.sitename.com/index.htm".  The link appears twice, one for the refresh action and the other to let spiders pass through so they can update their indexes.  Leave the TITLE tag of all the copied pages the same as shown in Fig. 1 - i.e. "Fix broken links (non-indexable page)".  This will serve as a simple means of finding them all en bloc, through a site-search, at any future time, or as a simple reminder of what the pages are for anytime you stumble across them within your off-line or online folders in the future.
3. When you are happy that all the copies you have made of fixlinks.htm have been correctly renamed, relocated, and the two redirection links have been repathed in each such copy, upload the pages.  You can now forget all about them while they quietly do their thing.  However, do remember, the next time you are thinking of moving, renaming or deleting any folders or pages, to follow this same procedure again so as to avoid causing any more broken external backlinks.
    
Fig. 1 (below)  This screengrab of Notepad displays the HTML code, ready to be copied and pasted into your own Notepad's window, and saved as an htm file (as detailed in step 1 in the LH column).  This will save typing out the code.  The code includes the controversial META Refresh tag.  For two different methods, see under the heading 'Options' in the LH column.
 fixlinks.htm - Notepad
  File     Edit    Search    Help
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Fix broken links (non-indexable page)</title>
<META NAME="robots" CONTENT="noindex,follow,noarchive">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=http://www.xxxx.com">
</head>
<body bgcolor="#FFFFFF">
<br>
<div align="center"><a href="http://www.xxxx.com">The required page has moved.<br>Please click here to transfer.</a></div>
<!-- For information on the purpose of this redirect page see... www.petermartinconsult.supan
et.com/computer/webpages/fixlinks.htm -->
</body>
</html>
 


  Tips   
  1.  robots.txt file
Assuming, after carrying out the procedures on this page, there are no remnant broken links on your website to any defunct folders or pages in your site, there will, consequently, be no links to point to the renamed copies of fixlinks.htm created with the procedure left.  This ensures spiders will not find and index these zero-content pages.  They are there purely to redirect any existing broken links on the internet, nothing else.  However, a comprehensive noindex Meta tag is included in the code in Fig. 1 above to discourage indexing - just in case there are any stray links still hiding in your online pages.  If you want to be doubly sure of preventing indexing of these pages, disallow them in a robots.txt file and upload that file as well.  You can find full instructions for creating and using such a file via an internet search for the term robots.txt.
 
  2.  Meta Refresh disabled
The code in Fig. 1 provides for instantaneous redirection to an alternative page of your choosing - but this will not work in the case of the tiny minority of users who might have disabled META REFRESH in their browser (a new Advanced option as of IE 6).  They would only see the redirection page but, to avoid them seeing it as a blank white screen, an ordinary blue link is included for them to click on.  This manual link will take them to the same page as all the people who have not disabled the REFRESH option.
 
  3.  .htaccess file
If your web pages are hosted on an Apache server, as many are, there is, supposedly, an alternative way to the one given on this page for redirecting broken links.  It is achieved by placing a text file called '.htaccess' (note the preceding dot) in your online root folder.  This file can be defined to automatically cause broken links to be redirected to alternative pages or to a customised 404 error-message page.  To check if you are on Apache, visit Server Types and type your URL in the box.  You can find full instructions for creating and using this special file via an internet search for the term  "htaccess".  However, htaccess files are prohibited by a good many hosts and ISPs, irrespective of the server type, so do not be surprised if this method proves to be not available to you if you try it.  However, you need have no such concerns about the method set out left, which will work irrespective of server type or host restrictions.
 
  4.  Redirection by JavaScript
Instead of using a META Refresh tag to achieve automatic redirection of visitors from a defunct page to a valid page, this can be done via a JavaScript.  This is a short and simple script that makes use of a link in the NOFRAMES tag of a non-evident frameset page to let spiders through.  More to follow (6.7.06)
 
  5.  HTML Validation
If you are a user of CSE HTML Validator Lite (recommended), note that the presence of a META Refresh tag in a page cause CSE to flag up one green error.  If you want to keep the tag, CSE includes a cloaking tag to stop the error message.
 
 
 
 
 
Menu          Top          Contact
 
First posted 9.7.03 (dmy)    Last amended 2.10.07    Copyright (C) 2003-2008 PM Designs    All Rights Reserved