urlrewrite.xml 2.6 KB
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.0//EN"
        "http://www.tuckey.org/res/dtds/urlrewrite3.0.dtd">

<urlrewrite default-match-type="wildcard">
    <rule match-type="regex">
        <from>^/admin/user/(.*)\$</from>
        <to type="forward">/app/admin/userform?id=$1&amp;from=list</to>
    </rule>
    <!-- The following fixes a CSS bug in CXF. -->
    <rule match-type="regex">
        <from>^/services//(.*)$</from>
        <to type="forward">/services/$1</to>
    </rule>

    <!-- Add rules here for anything that shouldn't be served up by Spring MVC. -->

    <rule>
        <from>/</from>
        <to type="redirect" last="true">%{context-path}/storage/chart.html</to>
    </rule>
    <rule>
        <from>/app/**</from>
        <to last="true" type="redirect">%{context-path}/$1</to>
    </rule>
    <rule>
        <from>/j_security_check</from>
        <to>/j_security_check</to>
    </rule>
    <rule>
        <from>/dataAccessFailure</from>
        <to>/dataAccessFailure</to>
    </rule>
    <rule>
        <from>/dwr/**</from>
        <to>/dwr/$1</to>
    </rule>
    <rule>
        <from>/services/**</from>
        <to>/services/$1</to>
    </rule>
    <rule>
        <from>/common/**</from>
        <to>/common/$1</to>
    </rule>
    <rule>
        <from>/assets/**</from>
        <to>/assets/$1</to>
    </rule>
    <rule>
        <from>/images/**</from>
        <to>/images/$1</to>
    </rule>
    <rule>
        <from>/scripts/**</from>
        <to>/scripts/$1</to>
    </rule>
    <rule>
        <from>/styles/**</from>
        <to>/styles/$1</to>
    </rule>
    <rule>
        <from>/webjars/**</from>
        <to>/webjars/$1</to>
    </rule>
    <rule>
        <from>/crossdomain.xml</from>
        <to>/crossdomain.xml</to>
    </rule>
    <rule>
        <from>/favicon.ico</from>
        <to>/favicon.ico</to>
    </rule>
    <rule>
        <from>/login*</from>
        <to>/login.jsp</to>
    </rule>
    <rule>
        <from>/logout*</from>
        <to>/logout.jsp</to>
    </rule>

    <!-- Spring MVC -->
    <rule>
        <from>/**</from>
        <to>/app/$1</to>
    </rule>
    <outbound-rule>
        <from>/app/**</from>
        <to>/$1</to>
    </outbound-rule>
    <!-- Remove JSESSIONID from URLs when cookies disabled -->
    <!-- http://stackoverflow.com/questions/962729/is-it-possible-to-disable-jsessionid-in-tomcat-servlet -->
    <outbound-rule encodefirst="true" match-type="regex">
        <name>Strip URL Session ID's</name>
        <from>^(.*?)(?:\;jsessionid=[^\?#]*)?(\?[^#]*)?(#.*)?$</from>
        <to>$1$2$3</to>
    </outbound-rule>
</urlrewrite>