Question : Using ColdFusion to set CGI variables

I would like my 404 error page (which is actually running my content management system) to set the CGI variables that get returned to the client.

For example, if you go to http://www.datacollaborative.com/Products, there is no real products page, so the server goes to the 404 page (template_a.cfm), which looks at the URL and creates the correct page on the fly.

However, some of the cgi variables still return the name of the 404 page, instead of "Products" - I am concerned that this will cause Search Engines to not index "Products" or any of my other pages either.

If you go to http://www.datacollaborative.com/test2, you can see a dump of the CGI structure, and you will see "template_a.cfm" prominently mentioned.

So I have two questions. First, do those CGI variables normally get returned to the client, and if so, are they going to confuse search engines? (that was actually one question)

Second, if this is a problem, is there a way I can set those CGI variables? I tried doing a cfset, and that did not work (no surprise). I also tried something like this:
      
and that did not work either.

Thanks for any help.

Answer : Using ColdFusion to set CGI variables

AFAIK, search engines aren't checking your CGI variables for information to index.  Although some CGI variables feature the name of your .cfm page, no user is going to know that, unless they're in the habit of inspecting page header information.  If the information is secret, then this is no good, but if you're just concerned they'll confuse the page names, then that shouldn't be a problem, assuming you can set your to whatever you intend it to be.

On another note, if this is meant to be a 404 page, it shouldn't return the response header of 200.  Which it does currently.  You should return the correct 404 response header.

Check this article or basically just put this at the very top (for genuine 404 messages)


Random Solutions  
 
programming4us programming4us