If I want to run a ColdBox app with URL rewrites e...
# box-products
p
If I want to run a ColdBox app with URL rewrites enabled from a directory (i.e. /example/ ), what configuration item do I need to change to make the rewrites point to /example/index.cfm instead of the root /index.cfm?
a
If you're running on CommandBox then thing this will do it:
Copy code
<rule>
	<note>ColdBox Survey Front-Controller URLs</note>
	<condition type="request-uri" operator="notequal">/(index.cfm|robots.txt|osd.xml|flex2gateway|cfide|cfformgateway|railo-context|lucee|admin-context|modules/contentbox-dsncreator|modules/contentbox-installer|modules/contentbox|files|images|js|javascripts|css|styles|config).*</condition>
	<condition type="request-uri" operator="notequal">\.(bmp|gif|jpe?g|png|css|js|txt|xls|ico|swf|woff|ttf|otf)$</condition>
	<condition type="request-filename" operator="notdir"/>
	<condition type="request-filename" operator="notfile"/>
	<from>^/mysubfolder/(.+)$</from>
	<to type="passthrough">/mysubfolder/index.cfm/$1</to>
</rule>
p
Interesting... So it has to be done by the server itself, and not ColdBox
I'm playing around with it in CommandBox right now, but at some point it will be deployed to IIS
a
Can do it on iis as well using Web.config some info jn the docs https://coldbox.ortusbooks.com/the-basics/routing/requirements/rewrite-rules
p
Where does the Tuckey file go for CommandBox?
Think I found it
m
put it where you want it, just specify where your custom xml file is
p
Thanks! Got it working in CommandBox now