Link to home
Start Free TrialLog in
Avatar of DataCollab
DataCollab

asked on

How can I use ColdFusion to affect the status code returned on a page request?

I know this is a little wierd, but I am using my 404 error page to run a content management system. For example, if you go to http://www.datacollaborative.com/AboutUs, there is no page called "AboutUs/index.cfm" or anything like it. So the server goes to the 404 page, which looks at the URL and decides what text to display.

The problem is that I am afraid that while the page looks fine, the header is sending back a 404 which will confuse search engines. For example, cgi.query_string="404;http://www.datacollaborative.com/aboutus".

I would like to specifically set the http status in my code, so I can send back a 200 if I want to indicate that the page is found (even though there is no real page with that filename), and a 404 if it really is not found. However, I cannot find any response header that will set the status code.

Thanks in advance for any help.

Also, if you are the kind of person who can help with this, you may also be able to help on a related question that I am posting simultaneously, where I am trying to send back header data that will include the (faked) resource location.
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DataCollab
DataCollab

ASKER

That did it!