Last active
August 29, 2015 14:12
-
-
Save neokoenig/9d467c585f90292a6a8a to your computer and use it in GitHub Desktop.
cfwheels tuckey urlrewrite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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)$</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">^/railo-context(.*)$</condition> | |
<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">^/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