[thelist] headers output at top of page after cflocation redirect

Sarah Adams mr.sanders at geekjock.ca
Tue Jul 17 10:09:09 CDT 2007

>> I've got a global 404 handler set up on a ColdFusion site. For the most
>> part it just says "page not found" and includes the site nav and search
>> to allow users to locate the content they want. But I also have it set
>> up to automatically redirect certain pages, mod_rewrite being disabled
>> at the host.
>> I've noticed, however, that sometimes when it redirects, the page that
>> is redirected to seems to have a bunch of headers being output at the
>> very top of the page. However this text does not appear in the View
>> Source, although it does appear in the DOM Inspector, as a text node
>> immediately under the body tag. Also, the headers output don't match the
>> actual headers that I see under Page Info. Here's what's output:
>> HTTP/1.1 200 OK
>> Server: Microsoft-IIS/5.0
>> Date: Wed, 27 Jun 2007 16:40:37 GMT
>> MicrosoftOfficeWebServer: 5.0_Pub
>> X-Powered-By: ASP.NET
>> Connection: close
>> Content-type: text/html
>> Page-Completion-Status: Normal
>> Page-Completion-Status: Normal
>> Has anyone ever seen something like this? Any suggestions for how to
>> make it stop?
> My finger of suspicion is the web server.
>> MicrosoftOfficeWebServer: 5.0_Pub
> Which I imagine is some flavour of IIS.  Does CF officially support this 
> webserver?

Yes, CF is supported on IIS.

> You might want to 301 redirect instead of using cflocation (which does a 302 
> redirect "Moved Temporarily") , try this:
> <cfheader statuscode="301" statustext="Moved Permanently">
> <cfheader name="Location" value="#the new location here#">
> <cfabort>

Great suggestion, thanks! At first when I used this suggestion, the
header issue got worse - the headers were printed out in the source, and
the page must have been served at text instead of HTML cause all I saw
was the source. Sent a ticket in to the host, who said there was nothing
wrong. And now the problem is gone. Hmmm... :) I wish I had an
explanation for why this was happening since I'd never seen anything
like this before, but oh well, it's gone, the client is happy, so I'm happy.

sarah adams
web developer & programmer
portfolio: http://sarah.designshift.com
blog: http://hardedge.ca

More information about the thelist mailing list