urlrewrite.xml 1.05 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
<?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">

<urlrewrite use-query-string="true">

	<rule>
		<name>Ignore JSP requests</name>
		<from>^/WEB-INF/(jsp|decorator)/</from>
		<to last="true">-</to>
	</rule>
	<rule>
		<name>Ignore proper localized requests</name>
		<from>^/[a-z]{2}(?:\-[a-z]{2})?/</from>
		<to last="true">-</to>
	</rule>
	
	<!-- English -->
    <rule>
       <from>^/([^?]+)\?lang=en$</from>
       <to last="true" type="permanent-redirect">/$1</to>
    </rule>
    <rule>
       <from>^/([^?]+)(?:\?(.*)&amp;|\?)lang=en(.*)$</from>
       <to last="true" type="permanent-redirect">/$1?$2$3</to>
    </rule>
    
    <!-- Other -->
    <rule>
       <from>^/([^?]+)\?lang=([a-z]{2})$</from>
       <to last="true" type="permanent-redirect">/$2/$1</to>
    </rule>
    <rule>
       <from>^/([^?]+)(?:\?(.*)&amp;|\?)lang=([a-z]{2})(.*)$</from>
       <to last="true" type="permanent-redirect">/$3/$1?$2$4</to>
    </rule>

</urlrewrite>