<?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">

<!-- Configuration file for UrlRewriteFilter http://www.tuckey.org/urlrewrite/ -->
<urlrewrite>

	<rule>
		<note>
			The rule means that requests to /test/status/ will be redirected to
			/rewrite-status
			the url will be rewritten.
		</note>
		<from>/test/status/</from>
		<to type="redirect">%{context-path}/rewrite-status</to>
	</rule>

	<!-- Legacy Rules -->
	<rule match-type="regex">
		<from>^/StartAuthentication$</from>
		<to type="forward">/dispatcher?mod=id_saml1&amp;action=GetArtifact</to>
	</rule>
	<rule match-type="regex">
		<from>^/StartAuthentication\?(.*)$</from>
		<to type="forward">/dispatcher?mod=id_saml1&amp;action=GetArtifact&amp;$1</to>
	</rule>

	<rule match-type="regex">
		<from>^/auth/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$</from>
		<to type="forward">/dispatcher?mod=$1&amp;action=$2</to>
	</rule>
	<rule match-type="regex">
		<from>^/auth/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)\?(.*)$</from>
		<to type="forward">/dispatcher?mod=$1&amp;action=$2&amp;$3</to>
	</rule>


	<rule match-type="regex">
		<from>^/pvp2/metadata$</from>
		<to type="forward">/dispatcher?mod=id_pvp2x&amp;action=Metadata&amp;%{query-string}</to>
	</rule>
	<rule match-type="regex">
		<from>^/pvp2/redirect$</from>
		<to type="forward">/dispatcher?mod=id_pvp2x&amp;action=Redirect&amp;%{query-string}</to>
	</rule>
	<rule match-type="regex">
		<from>^/pvp2/post$</from>
		<to type="forward">/dispatcher?mod=id_pvp2x&amp;action=Post&amp;%{query-string}</to>
	</rule>
	<rule match-type="regex">
		<from>^/PVP2Soap$</from>
		<to type="forward">/dispatcher?mod=id_pvp2x&amp;action=Soap</to>
	</rule>

	<outbound-rule>
		<note>
			The outbound-rule specifies that when response.encodeURL is called (if
			you are using JSTL c:url)
			the url /rewrite-status will be rewritten to /test/status/.

			The above rule and this outbound-rule means that end users should never
			see the
			url /rewrite-status only /test/status/ both in thier location bar and in
			hyperlinks
			in your pages.
		</note>
		<from>/rewrite-status</from>
		<to>/test/status/</to>
	</outbound-rule>

</urlrewrite>