Skip to main content
Inspiring
May 13, 2008
Question

URL Validation

  • May 13, 2008
  • 4 replies
  • 326 views
Hi,
Is there a way to check if a URL is exists? For instance to check to see if www.adobe.com exists. Can this be done with cfhttp?

Thanks!
    This topic has been closed for replies.

    4 replies

    Inspiring
    May 14, 2008
    spiders have absolutely nothing to do with this whatsoever.

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/
    Participant
    May 13, 2008
    Remember that a new url might not be picked up by spiders yet.
    Inspiring
    May 13, 2008
    tclaremont wrote:
    > You can use CFHTTP, and then check to see if there is any amount of size to the
    > returned file. That does NOT guarantee that there is any useful content or
    > anything like that, of course.
    >
    > Keep in mind that even a bad URL will return SOME content such as "File Not
    > Found" or something like that. For that reason, you dont want to base your
    > decisions on whether or not the returned file size is greater than zero.
    >

    You can also use the status property of the cfhttp results to see if you
    get an OK 200 status or some other status returned by the remote server.

    tclaremont
    Inspiring
    May 13, 2008
    You can use CFHTTP, and then check to see if there is any amount of size to the returned file. That does NOT guarantee that there is any useful content or anything like that, of course.

    Keep in mind that even a bad URL will return SOME content such as "File Not Found" or something like that. For that reason, you dont want to base your decisions on whether or not the returned file size is greater than zero.