coldfusion - Friendly Url in format 'mydomain.com/username' without Mod Rewrite? -


i know if there's easier way other mod rewrite (using fusebox framework or directly in coldfusion) convert url follows:

from:

http://www.somedomain.com/salmahayek or  http://localhost/someapp/salmahayek 

to:

http://www.somedomain.com/index.cfm?action=profile.view&name=salmahayek or http://localhost/someapp/index.cfm?action=profile.view&name=salmahayek 

my app existing fusebox 5.5 application.

i need add url above not static, i.e. "salmahayek" name.

any appreciated thanks

you potentially use "classic" way of doing (not sure if fusebox interfere), using 404 handler, should trick:

  1. set 404 hander on server, e.g. in .htaccess:

    errordocument 404 /404handler.cfm

  2. set 404handler.cfm wrap around framework, e.g.:

     <cfset variables.checksok = false>     <!--- checks - example --->     <cfif cgi.redirect_url eq 'salmahayek'>         <cfset variables.checksok = true>     </cfif>     <cfif variables.checksok eq true>         <cfheader statuscode="200" statustext="ok">         <cfset url.action = "profile.view">         <cfset url.name = cgi.redirect_url>         <cfinclude template="index.cfm">     </cfif> 

(not tested should work)


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -