Skip to main content
Participating Frequently
November 29, 2010
Question

301 track

  • November 29, 2010
  • 2 replies
  • 375 views

Hi forum,

is there a way to check a 301 header code?

I need to publish a list of URL, but I'd like to check (for every url) if it's a "fix" url (code 200) or a redirect (301 or 302).

If it's a redirect I need to publish the destination url.

Thanks.

    This topic has been closed for replies.

    2 replies

    Community Expert
    November 29, 2010

    Do you mean that you want to check this using client-side tools? You could use something like wget with logging enabled, then parse the responses from the log file. But you might not want to treat 302 responses the same way you treat 301 responses. A 302 response is a temporary redirect, which means that you might not go to the same URL in the future as a result of the redirect. They're commonly used when you submit a form - you go to the action page, which redirects you to a third page.

    Dave Watts, CTO, Fig Leaf Software

    http://www.figleaf.com/

    http://training.figleaf.com/

    Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on

    GSA Schedule, and provides the highest caliber vendor-authorized

    instruction at our training centers, online, or onsite.

    Read this before you post:

    http://forums.adobe.com/thread/607238

    Dave Watts, Eidolon LLC
    merlinoxAuthor
    Participating Frequently
    November 29, 2010

    No no I needed a server checker. But like I wrote up I resolved.

    Thanks.

    merlinoxAuthor
    Participating Frequently
    November 29, 2010

    Solution found: we can use cfhttp with redirect param to false.

    In the result struct we can check:

    x.responseheader.status_code

    If it is 301 or 302...

    Thanks!