Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

URL Validation

Participant ,
May 13, 2008 May 13, 2008
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!
289
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 13, 2008 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2008 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 13, 2008 May 13, 2008
Remember that a new url might not be picked up by spiders yet.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2008 May 13, 2008
LATEST
spiders have absolutely nothing to do with this whatsoever.

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources