Skip to main content
November 7, 2008
Question

Runtime Link Checker?

  • November 7, 2008
  • 2 replies
  • 336 views
I've got a page that displays dynamic links and there will be times where the destination file for some links will not exist, thus throwing a 404 error. The links that do not have a destination file may change from day to day. Is there a way to check the links before the page is displayed to see if the destination file exists? And if it does not, have ColdFusion display an icon next to those links that would throw a 404 error?
This topic has been closed for replies.

2 replies

Inspiring
November 14, 2008
ashe wrote:
> I've got a page that displays dynamic links and there will be times where the
> destination file for some links will not exist, thus throwing a 404 error. The
> links that do not have a destination file may change from day to day. Is there
> a way to check the links before the page is displayed to see if the destination
> file exists? And if it does not, have ColdFusion display an icon next to those
> links that would throw a 404 error?

You can use CFHTTP and the HEAD method.

--
Mack
Inspiring
November 9, 2008
Hi,

Have a look at the <cfhttp> tag.

cheers,
fober