forked from Horten-Folkeverksted/xwiki_urlrewrite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathurlrewrite.xml
45 lines (40 loc) · 1.25 KB
/
urlrewrite.xml
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
41
42
43
44
45
<?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 decode-using="null">
<rule>
<note>
Ensure that URLs that must not be served by the Struts Servlet are not modified.
</note>
<from>^/((bin|resources|skins|asyncrenderer|rest|webdav|xmlrpc|wiki|webjars)/(.*)|robots\.txt)$</from>
<to type="forward" last="true">-</to>
</rule>
<rule>
<note>
For all other URLs we prepend the "/bin/" prefix so that they get routed to the XWiki Action Servlet.
</note>
<from>^/(.*)$</from>
<to type="forward">/bin/$1</to>
</rule>
<outbound-rule>
<note>
Rewrite outbound URLs to remove the "/bin" part when there are two paths after it.
</note>
<from>/bin/(.*)/(.*)$</from>
<to>/$1/$2</to>
</outbound-rule>
<outbound-rule>
<note>
Rewrite outbound URLs to remove the "/bin" part when there's a single path after it.
</note>
<from>/bin/(.*)$</from>
<to>/$1</to>
</outbound-rule>
<outbound-rule>
<note>
Rewrite outbound URLs to remove the "/bin" part it's the last path.
</note>
<from>/bin$</from>
<to>/</to>
</outbound-rule>
</urlrewrite>