ColdFusion Search Engine Safe URLs
After seeing this post on SES URLs from Ray Camden, I noticed that the idea behind it was similar to what I was already using on this blog software. I didn't think it was all that incredible on it's own, buy maybe I was wrong. Anyway, here's the code I've been using in my application.cfm file:
<cfset urlstring = cgi.path_info>
<cfloop from="1" to=#ListLen(urlstring,"/")# index="i">
<cfif i mod 2>
<cfset paramName = "URL." & ListGetAt(urlstring,i,"/")>
<cfelse>
<cfparam name="#paramName#" default="#ListGetAt(urlstring,i,"/")#">
</cfif>
</cfloop>
This is written for general ColdFusion use, not the Model-Glue environment, so there's no check for an event variable. It's not too much different, but I thought I'd go ahead and post it. Feel free to use it for your own purposes, but please give credit where it's due.




Thanks for posting this. One thing I'd like to see in yours that Ray's does is to have it check for an event without a value. For instance:
http://www.whatever.com/index.cfm&contact&...
currently must be
http://www.whatever.com/index.cfm/contact/0/member...
but it should be
http://www.whatever.com/index.cfm/contact/member/0...
Thanks for posting this. One thing I'd like to see in yours that Ray's does is to have it check for an event without a value. For instance:
http://www.whatever.com/index.cfm&contact&...
currently must be
http://www.whatever.com/index.cfm/contact/0/member...
but it should be
http://www.whatever.com/index.cfm/contact/member/0...