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?
Thanks
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 = “^127.0.0.1”,
test = “^test.psomas.com”,
production = “^www.psomas.com”
};
…
function development(){
settings.sesIndex = “/index.cfm”;
}
`