404 Handler loses FORM scope
Owain North Sep 30, 2010 6:11 AMHowdy people, hoping someone can help me with this as I can't find anything previous.
Having only ever really written company internal systems, I've never really been that fussed about SEO. However I'm now working on a site where it's very important, so went about creating a handling page which would catch *any* page, figure out what you meant and using getPageContext().forward() to get the actual content. I've always known the theory behind doing so, but have never really gotten this far into the gubbins of it all.
Now what probably doesn't help is that I'm trying to be (maybe too) clever - I don't want Google and the suchlike flagging up "duplicate" content by having, for example, the site accessible by http://www.mysite.com/ and http://www.mysite.com/index.cfm. I appreciate that in theory this only requires me to not ever create links to the .cfm files, but sooner or later I will, or someone will figure one out, etc etc. Therefore I've tried storing all my .cfm pages *above* the web root, then using CF to get and include the content. Essentially, no pages actually exist (except the 404 page and 404 handler) - IIS routes all 404's to my CF handler page, as does my onMissingTemplate method (although this should never get hit if there are no .cfm pages).
However, I no longer have a FORM scope. Googling around seems to have revealed the issue - at some point recently IIS changed the way it calls your 404 handler - it now uses a separate thread to the original request, and so your submitted FORM values never get to CF.
So, my questions are:
1. Is there anything I can do about this? Have I jumped to the wrong conclusion?
or probably more sensible
2. Have I completely wandered so far down a dark pointless alley that I can no longer see the wood for the trees, and so have come up with a massively convoluted system which is far more complex than it ever needed to be?
I'd suspect the latter, but I'm sure I'm not the first person to want a site to work in this way. I apologise for a post on the boring old subject of SEO but hopefully this is a little more in-depth than the standard "how do I SEO my site" question. As I say I've got everything working - examining the URL, figuring out which page to go from an XML document and even translating the url into variables which I pass to the included pages. Everything works, except I have no FORM scope.
If anyone can point me in the right direction, I'd be most appreciative.
O.

