Firstly, I do not recommend reinventing the wheel. Web servers do this and do it well.
Cold Fusion can do something similar with #cgi.path_info#. You can jump over some hoops, as Adam Tuttle explains here: Can I have a “friendly” URL without rewriting the URLs in IIS? .
Option # 2: My Favorite: OnMissingTemplate ..
Application.cfc( , .cfm onMissingTemplate).
application.cfc, "" URL- .
<cffunction name="onMissingTemplate">
<cfargument name="targetPage" type="string" required=true/>
<cftry>
<cfset local.pagename = listlast(cgi.script_name,"/")>
<cfswitch expression="#listfirst(cgi.script_name,"/")#">
<cfcase value="blog">
<cfinclude template="mt_blog.cfm">
<cfreturn true />
</cfcase>
</cfswitch>
<cfreturn false />
<cfcatch>
<cfreturn false />
</cfcatch>
</cftry>
</cffunction>
mt_blog.cfm , , URL- /blog/How -to-train-your-flea-circus.cfm
<cfset pagename = listfirst(listlast(cgi.script_name,"/"),".")>
<cfquery name="getblogpost">
select bBody,bTitle,bID
from Blog
where urlname = <cfqueryparam cfsqltype="cf_sql_varchar" value="#pagename#">
</cfquery>
...
, URL-, /blog/ 173_How-to-train-your-flea-circus.cfm( 173 - )
<cfset pageID = listfirst(listlast(cgi.script_name,"/"),"_")>
<cfquery name="getblogpost">
select bBody,bTitle,bID
from Blog
where bID = <cfqueryparam cfsqltype="cf_sql_integer" value="#pageID#">
</cfquery.
...