Re: How to implement link checking in the content a CMS stores

Adam Fields <[email protected]>
Newsgroups gmane.comp.cms.cms-forum.general
Message-ID <[email protected]>
On Mon, Feb 07, 2005 at 02:49:12PM -0600, Austin, Darrel wrote:
> For those of you that build CMSes, how do you handle the checking of links
> within the content of the CMS.
> 
> For instance, you have page content stored in a DB record. This content is
> formatted HTML, and has a link to another page on your site. This other page
> is later deleted, and now you have a bad link.
> 
> I'm guessing the weak link here is storing URIs as hard-coded in the HTML.
> Are there practical alternatives to that? If not, are there any products out
> there that folks would recommend that would scan the site externally looking
> for bad links? 

I've always favored including links as a specialized tag reference
rather than as URIs.

So we store the link mappings in a table, and give the content editors
a tool for adding links (internal or external) and a specification for
referencing them in documents, usually by id or shortname. Then, you
can run through that whole table pretty easily and see where the
broken links are. This is pretty clean, and you can do image or object
references the same way.

At some point, you're either doing dynamic page delivery or generating
pages, so it's pretty trivial to parse for link references at that
point.

For scanning after the fact, I usually use wget for spidering.

There's some helpful stuff about that here:

http://ftp.stardiv.de/chk/chk.html


-- 
				- Adam

-----
** My new project --> http://www.visiognomy.com/daily
   **  Flagship blog --> http://www.aquick.org/blog
Hire me: [ http://www.adamfields.com/Adam_Fields_Resume.htm ]
Links:   [ http://del.icio.us/fields ]
Photos:  [ http://www.aquick.org/photoblog ]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.