Embedded server and url rewrite

After some tests it seems that tuckey url rewrite filter does not work with the embedded server. I have followed the instructions on UrlRewriteFilter - Rewrite URL's in Java Web Application Servers without success.

I have added the urlrewrite.xml and web.xml on .CommandBox\server\WEB-INF but it seems not work if I try to reach the url localhost:myportnumer/rewrite-status.

Some expert could share his configuration to enable url rewriting?


Here are the ones from ContentBox that work:


Luis Majano
Ortus Solutions, Corp
P/F: 1-888-557-8057
Direct: (909) 248-3408

ColdBox Platform: http://www.coldbox.org

ContentBox Platform: http://www.gocontentbox.org
Linked In: http://www.linkedin.com/pub/3/731/483

Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano | twitter.com/gocontentbox

I have tried with those files without success.

I should put urlrewrite.xml and web.xml in .CommandBox\server\WEB-INF?

I should put urlrewritefilter-4.0.3.jar in .CommandBox\server\railo-server\context\lib?

Francesco, any recent success? I’ve tried the contentbox files too but get it to work. I still just get “Not Found” error

By the way, since I’m only concerned about friendly URLs in production, I detect the environment in Routes.cfm and appropriately remove “/index.cfm” only for production and in development(which uses embedded server) I leave in “/index.cfm”.

// Base URL if( len(getSetting('AppMapping') ) lte 1){ setBaseURL("http://#cgi.HTTP_HOST##getSetting('sesIndex')#"); } else{ setBaseURL("http://#cgi.HTTP_HOST#/#getSetting('AppMapping')##getSetting('sesIndex')#"); }

In coldbox.cfc:

// custom production settings
settings = {
sesIndex = “”

// environment settings, create a detectEnvironment() method to detect it yourself.
// create a function with the name of the environment so it can be executed if that environment is detected
// the value of the environment is a list of regex patterns to match the cgi.http_host.
environments = {
development = “^”,
test = “^test.psomas.com”,
production = “^www.psomas.com

function development(){
settings.sesIndex = “/index.cfm”;


Luis just pointed out to me today that the PresideCMS guys already have this working in their server start commands.

If you look at their repo you can see these two files have the bits:




ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com