How to setup url rewriting for Wheels with JRUN
Published on
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>
COLDFUSION
C:\JRun4\servers\cfwheels\cfusion.ear\cfusion.war\WEB-INF\urlrewrite.xml
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
COLDFUSION
CF Monitoring Filter mappings
COLDFUSION
</context-param>
COLDFUSION
http://cfunited.local/test/status/
COLDFUSION
/
COLDFUSION
something
COLDFUSION
something
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