Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Tuckey urlrewrite.xml config file for Lucee server
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 4.0//EN"
"http://www.tuckey.org/res/dtds/urlrewrite4.0.dtd">
<urlrewrite>
<rule>
<note>
Allow TomCat to have SES links.
</note>
<!--
If our URI ends with one of these extentions we will not perform
a URL rewrite.
-->
<condition type="request-uri" operator="notequal">\.(bmp|gif|jpe?g|png|css|js|txt|pdf|doc|xls|cfc|ico|php|asp|ico|zip|tgz|gz|rar|bz2|tar|wav|rtf|flv|swf|html|htm|map|ttf|woff)$</condition>
<!--
If any URI begins with one of these directories, we will not
perform a rewrite. Helpful for running your unit tests or
"blocking" rewrite for some directories.
-->
<condition type="request-uri" operator="notequal">^/lucee(.*)$</condition><!-- comment out this line to diabled access to lucee admin -->
<condition type="request-uri" operator="notequal">^/flex2gateway(.*)$</condition>
<condition type="request-uri" operator="notequal">^/jrunscripts(.*)$</condition>
<condition type="request-uri" operator="notequal">^/cfide(.*)$</condition>
<condition type="request-uri" operator="notequal">^/cfformgateway(.*)$</condition>
<condition type="request-uri" operator="notequal">^/assets(.*)$</condition>
<condition type="request-uri" operator="notequal">^/files(.*)$</condition>
<condition type="request-uri" operator="notequal">^/images(.*)$</condition>
<condition type="request-uri" operator="notequal">^/javascripts(.*)$</condition>
<condition type="request-uri" operator="notequal">^/miscellaneous(.*)$</condition>
<condition type="request-uri" operator="notequal">^/stylesheets(.*)$</condition>
<condition type="request-uri" operator="notequal">^/favicon.ico(.*)$</condition>
<condition type="request-uri" operator="notequal">^/robots.txt(.*)$</condition>
<condition type="request-uri" operator="notequal">^/sitemap.xml(.*)$</condition>
<condition type="request-uri" operator="notequal">^/rewrite.cfm(.*)$</condition>
<condition type="request-uri" operator="notequal">^/health.html(.*)$</condition>
<condition type="request-uri" operator="notequal">^/public(.*)$</condition>
<!--
If you require support for nice urls with provides,
like blabla.json or blabla.xml you better use
<from>^/(.*?)(?:\.([a-z]{3,4}))?(&.*)$</from>
<to type="passthrough" last="true">/rewrite.cfm/$1?format=$2$3</to>
for example :
/customers/create.json&company[customer][name]=bob&;..
theoretically should map to:
/rewrite.cfm/customers/create?format=json&company[customer][name]=bob&;..
For each output format xml, json, pdf, xls... remove
them from the conditions for extensions above
-->
<from>^/(.*)$</from>
<to type="passthrough" last="true">/rewrite.cfm/$1</to>
</rule>
</urlrewrite>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment