Skip to main content
Inspiring
November 20, 2008
Question

Odd....

  • November 20, 2008
  • 2 replies
  • 574 views
I'm trying to display a page with <cfhttp> by using:

<cfhttp url="https://www.memberst.com/Programs/ProgramGuide.aspx?id=#returnString#&tagid=420"
port="443"></cfhttp> where returnString is a random number sequence......

When I try that, I get displayed on the page:

Object moved to here.


But when I have a link on a different page that points to:
<a href="https://www.memberst.com/Programs/ProgramGuide.aspx?id=#urlString#&tagid=420">
and click on the link, it works fine.

Why would this be? Any suggestions?


    This topic has been closed for replies.

    2 replies

    Inspiring
    November 21, 2008
    steve grosz wrote:
    > I'm trying to display a page with <cfhttp> by using:
    >
    > <cfhttp
    > url="https://www.memberst.com/Programs/ProgramGuide.aspx?id=#returnString#&tagid=420"
    > port="443"></cfhttp> where returnString is a random number sequence......
    >
    > When I try that, I get displayed on the page:
    >
    > Object moved to here.
    >
    >
    > But when I have a link on a different page that points to:
    > <a
    > href="https://www.memberst.com/Programs/ProgramGuide.aspx?id=#urlString#&tagid=420">
    > and click on the link, it works fine.
    >
    > Why would this be? Any suggestions?
    >
    >

    What status code do you get from this request.

    My first guess would be that the url you are requesting is returning one
    of the redirect 30X statuses. A browser, that follows the link,
    automatically follows the redirect and gets the content from the new
    location. CFML does not assume you want to do this and expects you to
    code the logic on how you want to handle this redirect status.
    Inspiring
    November 21, 2008
    Hello Ian,

    I am getting a 302 Found status code.

    So how would you handle the redirect status??

    > steve grosz wrote:
    >
    >> I'm trying to display a page with <cfhttp> by using:
    >>
    >> <cfhttp
    >> url="https://www.memberst.com/Programs/ProgramGuide.aspx?id=#returnSt
    >> ring#&tagid=420" port="443"></cfhttp> where returnString is a random
    >> number sequence......
    >>
    >> When I try that, I get displayed on the page:
    >>
    >> Object moved to here.
    >>
    >> But when I have a link on a different page that points to:
    >> <a
    >> href="https://www.memberst.com/Programs/ProgramGuide.aspx?id=#urlStri
    >> ng#&tagid=420">
    >> and click on the link, it works fine.
    >> Why would this be? Any suggestions?
    >>
    > What status code do you get from this request.
    >
    > My first guess would be that the url you are requesting is returning
    > one of the redirect 30X statuses. A browser, that follows the link,
    > automatically follows the redirect and gets the content from the new
    > location. CFML does not assume you want to do this and expects you to
    > code the logic on how you want to handle this redirect status.
    >


    November 21, 2008
    Try the attribute: resolveURL="true" or resolveURL="yes"...can't remember if it's true or yes, CF seems to use them interchangeably!!

    I haven't even tried, but I always use that.

    Cheers,
    Mikey.
    Inspiring
    November 21, 2008
    Hello Kapitaine,

    Hmmmm, even after adding the resolveurl to the tag, I'm still getting:

    Object moved to here.


    > Try the attribute: resolveURL="true" or resolveURL="yes"...can't
    > remember if it's true or yes, CF seems to use them interchangeably!!
    >
    > I haven't even tried, but I always use that.
    >
    > Cheers,
    > Mikey.