Index: web.xml
===================================================================
--- web.xml	(revision 3062)
+++ web.xml	(working copy)
@@ -1,42 +1,56 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 
 <!DOCTYPE web-app
-  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
-  "http://java.sun.com/dtd/web-app_2_3.dtd">
+        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+        "http://java.sun.com/dtd/web-app_2_3.dtd">
 
 <web-app>
 
-  <display-name>xwiki</display-name>
-  <description>XWiki Application</description>
+    <display-name>xwiki</display-name>
+    <description>XWiki Application</description>
 
-  <!-- Define context level parameters for XWiki's initialization -->
-  <context-param>
-    <param-name>org.apache.velocity.properties</param-name>
-    <param-value>/WEB-INF/velocity.properties</param-value>
-    <description>Velocity's configuration</description>
-  </context-param>
+    <!-- Define context level parameters for XWiki's initialization -->
+    <context-param>
+        <param-name>org.apache.velocity.properties</param-name>
+        <param-value>/WEB-INF/velocity.properties</param-value>
+        <description>Velocity's configuration</description>
+    </context-param>
 
-  <filter>
-    <filter-name>Set Character Encoding</filter-name>
-    <filter-class>com.xpn.xwiki.web.SetCharacterEncodingFilter</filter-class>
-    <init-param>
-      <param-name>encoding</param-name>
-      <param-value>ISO-8859-1</param-value>
-    </init-param>
-  </filter>
+    <filter>
+        <filter-name>Set Character Encoding</filter-name>
+        <filter-class>com.xpn.xwiki.web.SetCharacterEncodingFilter</filter-class>
+        <init-param>
+            <param-name>encoding</param-name>
+            <param-value>ISO-8859-1</param-value>
+        </init-param>
+    </filter>
 
-  <filter-mapping>
-    <filter-name>Set Character Encoding</filter-name>
-    <url-pattern>/*</url-pattern>
-  </filter-mapping>
+    <filter>
+        <filter-name>ReWrite</filter-name>
+        <filter-class>com.xpn.xwiki.web.ReWriteFilter</filter-class>
+        <init-param>
+            <param-name>rules</param-name>
+            <param-value>XWiki.ReWriteRules</param-value>
+        </init-param>
+    </filter>
 
-  <!-- XWiki's initialization is done in a Servlet Context Listener. This is where we set up
-       everything that should be initialized prior to XWiki servicing requests. For example this
-       is where we initialize Velocity. -->
-  <listener>
-    <listener-class>com.xpn.xwiki.web.InitializationServletContextListener</listener-class>
-  </listener>
-  
+    <filter-mapping>
+        <filter-name>ReWrite</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+    <filter-mapping>
+        <filter-name>Set Character Encoding</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+    <!-- XWiki's initialization is done in a Servlet Context Listener. This is where we set up
+everything that should be initialized prior to XWiki servicing requests. For example this
+is where we initialize Velocity. -->
+    <listener>
+        <listener-class>com.xpn.xwiki.web.InitializationServletContextListener</listener-class>
+    </listener>
+
     <servlet>
         <servlet-name>action</servlet-name>
         <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
@@ -72,15 +86,15 @@
         <servlet-class>com.xpn.xwiki.web.HomePageRedirect</servlet-class>
     </servlet>
 
-     <servlet>
+    <servlet>
         <servlet-name>xmlrpc</servlet-name>
         <servlet-class>com.xpn.xwiki.xmlrpc.XWikiXmlRpcServlet</servlet-class>
         <init-param>
-          <param-name>enabledForExtensions</param-name>
-          <param-value>false</param-value>
-          <description>Sets, whether the servlet supports vendor extensions for XML-RPC.</description>
+            <param-name>enabledForExtensions</param-name>
+            <param-value>false</param-value>
+            <description>Sets, whether the servlet supports vendor extensions for XML-RPC.</description>
         </init-param>
-     </servlet>
+    </servlet>
 
     <!-- This is for the GWT support. Currently the GWT Java files are not being built so we need
          to disable this. In the future, once we have GWT integrated in the build we'll need to
@@ -136,8 +150,8 @@
     </error-page>
     -->
     <error-page>
-      <error-code>404</error-code>
-      <location>/xwiki/bin/view/Main/DocumentDoesNotExist</location>
+        <error-code>404</error-code>
+        <location>/xwiki/bin/view/Main/DocumentDoesNotExist</location>
     </error-page>
 
     <!-- Example Application Tag Library Descriptor
