I'm having problems using a trick that's been working for me with CF for a long time now, but just doesn't seem to work with spectra.
I have a spectra site made up entirely of virtual pages being rendered from one cfm page. In order to hide the 'messy' url parameters required to specify the page you want, and to make search engines spider the site, I've always set the 'Missing Template Handler' setting in 'Settings' in the CF admin page to be a file called 404.cfm, then had it examine the requested script name and set the correct URL parameters then cfinclude the proper file.
eg. If I wanted to go to: page.cfm?id=abcd I would go to: page_abcd.cfm This would cause the 'Missing Template Handler' file to be run, which has this code: <cfif left(cgi.SCRIPT_NAME,6) is "/page_" and right(cgi.SCRIPT_NAME,4) is ".cfm"> <cfset url.id = mid(cgi.SCRIPT_NAME, 7, len(cgi.SCRIPT_NAME)-10)> <cfinclude template="/page.cfm"> <cfelse>
This makes the browser think you're still looking at the page you requested (which using cflocation won't do), and hides all the working bits. The file must still end with .cfm or CF won't parse it, and you can't just change the setting in the Netscape webserver admin to use its 404 error page, because it won't pass it to CF for parsing.
This has always worked for me with any CF page, but when I use it on a spectra page it gives this error: --------------------------- Error Occurred While Processing Request Error Diagnostic Information An error has occurred.
HTTP/1.0 404 Object Not Found --------------------------- It is throwing this error as it hits the cfa_page statement in the page.cfm file. There is nothing else above this statement, and the same page works perfectly if you directly call it, or even just change the cfinclude to a cflocation (and add the url parameter to the page name) however it changes the URL to the new one, so is of no use.
Anyone got any ideas? Do I have to abandon this approach and return to using messy Url parameters and never get my site spidered by a search engine?
Regards
Darren Tracey Web Developer Thiess Australia
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm ------------------------------------------------------------------------------ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/spectra_talk or send a message to spectra-talk-request@houseoffusion.com with 'unsubscribe' in the body.