Webmasters Weaponry
Machinehead Software Machinehead Software
Machinehead Software Machinehead Software
Webmasters Weaponry

Hypertext Link Rewiring and Remapping

Link Re wiring and re mapping
Link Re wiring and re mapping Redirector pages File format conversion text replacement word phrase or link count Hypertext Link Rewiring and Remapping Word Count Statistics

The webmasters weaponry toolkit can automate the process of changing all the hypertext links on your page or pages from relative references into absolute references (hard wiring), or from absolute references into relative references (soft wiring).

Absolute reference can take any of the following forms:
"http://www.domain.com"
"http://www.domain.com/"
"http://www.domain.com/filename.html"
"http://www.domain.com/directory/filename.html"
"http://www.domain.com/directory/filename.html#LocationInPage"
etc.

Where:
http:// is the protocol
www.domain.com is the domain
directory is one or more directories
filename.html is the name of the web page
#LocationInPage is an <a name="LocationInPage"> style tag
The only way to link to another domain is with an absolute reference

Relative references take following forms:
"filename.html"
"directory/filename.html"
"directory/filename.html#LocationInPage"
"../directory/filename.html"
"../../directory/filename.html"
etc.
Note:-filename.html could equally be filename.gif, .png, .jpg etc WMW doesn't check the extension of the file so valid links to all file types get re mapped in one pass.

Soft wired relative references are the norm because by leaving out the protocol and domain the site will work just as well if you copy it to any domain, and it will also work just fine when you test it off line on your local hard disk.

Hard wired absolute references can also be pretty handy when moving domains. (See Redirector Page Maker). Instead of simply creating a set of fairly dull pages all containing the same dull apology and a single link to your home page why not simply insert the redirect met tag at the top of each page with at least 60 seconds delay, then hard wire every link so every graphic, script, page etc that the page links to points directly to the version on the new domain? That someone surfing in from a search engine to the old location will not be inconvenienced, and any search engine spiders that don't understand the redirection meta tag should also find all your other pages more quickly too ;-)

You might also find Hard wired links handy if working with https!

How It Works

In the default file combo the text index.html appears this is the file that the server sends when the domain is requested without a file name. You only need this for converting absolute references into relative references ie soft coding hard coded hypertext links. This could be set for any default web page name (consult your web host if you arn't sure). WMW is pretty flexible you can add and remove names from any of the file combos by entering some new text (be careful what you ask for!) and clicking the plus button, or simply click the minus button to remove the current item.

As supplied the Webmasters Weaponry toolkit knows about the following protocols (because these are what it was designed for):
http://
https://
Can't think of any other useful protocols but you can add others by entering the text into the file combo then clicking the plus button. Click the minus button to remove a protocol.

The link types that I currently use are: href="
src="
background="
@import url("
window.open("

PreLoadImage(' is a custom javascript function used throughout my site to pre load a graphic for doing mouseover's. It is unlikely that you will be using this one but highly likely that you will have similar functions that you might wish to add to the list. If you do this don't forget the quote mark, WMW assumes that everything between PreLoadImage(' and the next ' is a valid path to a file and will attempt to adjust it accordingly.

href=" is the standard form of hypertext link and pretty safe. WMW will even re wire document.href="filename.html" but be carefull because if you have used this javascript notation in the form document.href="part_of_filename" + stringVariable + stringVariable; WMW will attempt to rewire part_of_filename as a valid path..

SRC=" Is mostly used for graphics, but can also be the path to a separate javascript.js file.

background=" Is on the list because it is used in some of my pages to specify a background graphic within my <head> tag.

@import url(" is in the list because it specifies the path to a style sheet.

window.open(' is a javascript call to open a new browser window.

<OPTION VALUE=" is on the list because the drop down lists on my home page uses these tags to specify the names of HTML files. Use with care.... many other pages on my site contain these drop down lists but for different reasons. Obviously this is a case where I would simply run the rewire script on a single page rather than the entire directory full of pages.

When re wiring the protocol and link type you have selected are searched for in a case insensitive way so HREF=, href=, Href= etc will all be found and treated the same. The protocols and link types will be output in the exact case you have specified though (i.e. all identical). This won't make any difference within the HTML part of your page, but javascript is case sensitive, so this might just correct the odd typo in the priocess!).

The upper half of WMW's display shows the actual files that are being rewired - THESE CAN BE PHYSICALLY LOCATED ANYWHERE ON YOUR HARD DISK. WMW doesn't look at the directory structure on your local disk when re wiring hypertext links. Instead it uses the virtual path that you have specified. To set the virtual path first double click the 'home directory' for your local disk (upper half), then click the refresh virtual directory button, then click on the appropriate subdirectory in the (lower) virtual directory tree. In the example above this is www.machinehead-software.co.uk/web_tools and this the directory that WMW assumes the files will actually be located in on the server. The actual file(s) can be physically located anywhere on your hard disk including any temporary working directory that you might choose to create. WMW's virtual directory tree and be pruned to your hearts content and saved as a file. Anything listed in your 'Output sub directory' list is assumed not to be part of your site and automatically excluded from the tree. Other directories can be added, removed, or dragged from one location into another. I must stress here that 'removed' is not the same as 'deleted'. The remove button does NOT delete any of your real files or directories it merely removes a node from the tree display. (Just thought I would mention that because I met some drongos who simply wouldn't accept that there is any difference in a very similar senario!)

See Also
Redirector Page Maker | Hypertext Link Replacer | Page Mover | link Validator

Webmasters Weaponry Home
Miscellaneous Downloads Home
Music Player Home
Cycle Software Home

Page Design by Nigel Jones and the Machinehead Programming Team Machinehead Software