How can I set HTTP Status code 301 on redirecting toanother coldfusion page

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default How can I set HTTP Status code 301 on redirecting toanother coldfusion page

    I have an application that intercepts a 404 error and redirects to a new CF
    page. Currently, search engines and other robots only see the 404 error. I am
    currently using cflocation to set the url. Can anyone give me an idea how to
    redirect and send an HTTP status code of 301 for permanantly moved? I've tried
    setting the status using the CFHEADER tag above the CFLocation but than it
    never redirects and gets a true 404 error.

    Any help appreciated.

    JohnK1965 Guest

  2. Similar Questions and Discussions

    1. HTTP Status 500 Error with SSL
      Background: I can browse to http://me.com/flex2gateway/ and receive a blank page with no errors. I cannot browse to https://me.com/flex2gateway/ -...
    2. HTTP Status-Code=503 (Service Unavailable)
      Hello, I'm doing a performance test and my test graudually increases the connections to the webservice. Everything works well until my...
    3. Redirecting HTTP request
      Here's my requirement: When a desktop application (smart client) makes a request to our ASP.NET server, the request has to be redirected to a 3rd...
    4. HTTP status 401
      Hi All, I have a webservice on a win 2003 server and I'm trying to call it from another win2003 server which is hosting my sharepoint portal...
    5. #19113 [Com]: HTTP status 200 returned on HTTP CONNECT when mod_proxy not in use
      ID: 19113 Comment by: arafuse at bcexplorers dot com Reported By: php_new at jdc dot parodius dot com Status: ...
  3. #2

    Default Re: How can I set HTTP Status code 301 on redirecting to anothercoldfusion page

    JohnK1965 wrote:
    > I have an application that intercepts a 404 error and redirects to a new CF
    > page. Currently, search engines and other robots only see the 404 error. I am
    > currently using cflocation to set the url. Can anyone give me an idea how to
    > redirect and send an HTTP status code of 301 for permanantly moved? I've tried
    > setting the status using the CFHEADER tag above the CFLocation but than it
    > never redirects and gets a true 404 error.
    >
    > Any help appreciated.
    >
    As far as I can tell, these lines are equivalent:

    <cfsetting showdebugoutput="false" />
    <!--- Method 1 --->
    <cflocation url="drop_shadow.html" />
    <cfabort />
    <!--- Method 2 --->
    <cfheader name="Location" value="drop_shadow.html" />
    <cfheader statusCode="302" statusText="Found" />
    <cfabort />

    Both throw a 302 code on my server.

    Maybe it would help to turn off HTTP Status Codes in the cf
    administrator? Or, perhaps your frontend web server is having some play
    in this situation.

    Joe Gooch
    K12 Systems, Inc.
    Joseph Gooch Guest

  4. #3

    Default Re: How can I set HTTP Status code 301 on redirecting toanother coldfusion page

    I am looking for the same solution. When I try:

    <cfheader statusCode="301" statusText="Moved Permanently">
    <cfheader name="Location" value="#newURL#">

    it still returns a 302. Does anyone know a solution? Do you get the same
    response?

    James-Pr Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139