How to setup url rewriting for Wheels with JRUN

cfwheels ColdFusion jrun

Download the binary from Url Rewrite Filter and read the instructions. It is 4 steps. I'll break from the steps after the first one. Step 1: "extract it into your context's directory ie, so that urlrewrite.xml goes into the WEB-INF directory." I download urlrewritefilter-3.2.0.zip and moved the files to

COLDFUSION
C:\JRun4\servers\cfwheels\cfusion.ear\cfusion.war\WEB-INF<br>
Open urlrewrite.xml, my file was located at
COLDFUSION
C:\JRun4\servers\cfwheels\cfusion.ear\cfusion.war\WEB-INF\urlrewrite.xml
Search for INSTALLATION, then copy the filter and filter-mapping code from it.

COLDFUSION
<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
<init-param>
logLevel
WARN
</init-param>
</filter>
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

Next open your web.xml Mine was located at

COLDFUSION
C:\JRun4\servers\cfwheels\cfusion.ear\cfusion.war\WEB-INF\web.xml
Search for
COLDFUSION
CF Monitoring Filter mappings
and paste the copied filter and filter-mapping code above this. You should be below the last
COLDFUSION
</context-param>
. Restart your jrun instance and test. My test url was
COLDFUSION
http://cfunited.local/test/status/
(be sure to have the ending
COLDFUSION
/
) You should be redirected to rewrite-status. This means the url rewriting filter is working. Now to add the CFWheels url rewriting I used the .htaccess file within the CFWheels download for the rules below. Copy the code below and paste it below the
COLDFUSION
something
and above the
COLDFUSION
something
in urlrewriting.xml.

COLDFUSION
The rule is for making CFWheels URLs prettier using URL rewriting.
# http://cfwheels.org/docs/chapter/url-rewriting
# RewriteCond %{REQUEST_URI} !^.<em>/(flex2gateway|jrunscripts|cfide|cfformgateway|railo-context|files|images|javascripts|miscellaneous|stylesheets|robots.txt|sitemap.xml|rewrite.cfm)($|/.</em>$) 
# RewriteRule ^(.*)$ ./rewrite.cfm/$1 
^.<em>/(flex2gateway|jrunscripts|cfide|cfformgateway|railo-context|files|images|javascripts|miscellaneous|stylesheets|robots.txt|sitemap.xml|rewrite.cfm)
^(.</em>)$
/rewrite.cfm/$1