Changes for page Short URLs

Last modified by Vincent Massol on 2024/03/27

<
From version < 64.1 >
edited by Vincent Massol
on 2017/11/21
To version < 67.1 >
edited by slauriere
on 2019/09/16
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.VincentMassol
1 +XWiki.slauriere
Content
... ... @@ -46,10 +46,10 @@
46 46  
47 47  * ##/resources/*## and ##/skins/*##: Statically served resources. These need to be served directly as static resources.
48 48  * ##/rest/*##: REST resources, served by the XWiki REST Servlet
49 -* ##/xmlrpc/*##: XML-RPC resources, served by the XWiki XMLRPC Servlet {{warning}}Not part of XE anymore since 7.3{{/warning}}
50 -* ##/resources/~*~*/*.gwtrpc##: GWT-RPC calls, served by the XWiki GWT Servlet
51 -* ##/webdav/*##: WebDav calls, served by the XWiki WebDAV Servlet
52 -* ##/XWikiService##: Another XWiki GWT Servlet
49 +* ##/xmlrpc/*##: XML-RPC resources, served by the XWiki XMLRPC Servlet {{warning}}Not part of XWiki anymore since 7.3{{/warning}}
50 +* ##/resources/~*~*/*.gwtrpc##: GWT-RPC calls, served by the XWiki GWT Servlet {{warning}}Not part of XWiki anymore since 9.7RC1{{/warning}}
51 +* ##/webdav/*##: WebDav calls, served by the XWiki WebDAV Servlet {{warning}}Not part of XWiki anymore since 8.0M1{{/warning}}
52 +* ##/XWikiService##: Another XWiki GWT Servlet {{warning}}Not part of XWiki anymore since 9.7RC1{{/warning}}
53 53  * ##/redirect##: The XWiki Redirect Servlet used to redirect to the home page when no page is specified in the URL
54 54  
55 55  There are various alternate to achieve this:
... ... @@ -72,7 +72,7 @@
72 72  
73 73  1. [[Download the JAR>>http://www.tuckey.org/urlrewrite/]] and put it in ##WEB-INF/lib##
74 74  1. Edit your ##WEB-INF/web.xml## and add the ##<filter>## and ##<filter-mapping>## definitions [[as documented>>http://www.tuckey.org/urlrewrite/]]. Make sure to have them first so that they're executed before any other XWiki filter.
75 -1. Drop the following content belo< in a file at ##WEB-INF/urlrewrite.xml##:(((
75 +1. Drop the following content below in a file at ##WEB-INF/urlrewrite.xml##:(((
76 76  Note that this is just an example and you should tune it depending on what you wish to achieve. Its principle is very simple: it takes some URL format you wish to have and convert those URLs into the format that XWiki expects in input, and, in output, it does the opposite and converts the XWiki format into the format you wish to have.
77 77  
78 78  The example below expects URLs without a ##/bin## and thus adds it so that XWiki has it when it processes URLs and in output, removes the ##/bin## so that generated URLs are without ##/bin##.
... ... @@ -96,7 +96,7 @@
96 96   <note>
97 97   Ensure that URLs that must not be served by the Struts Servlet are not modified.
98 98   </note>
99 - <from>^/((bin|resources|skins|rest|webdav|xmlrpc|wiki|webjars)/(.*)|robots\.txt)$</from>
99 + <from>^/((bin|resources|skins|asyncrenderer|rest|webdav|xmlrpc|wiki|webjars)/(.*)|robots\.txt)$</from>
100 100   <to type="forward" last="true">-</to>
101 101   </rule>
102 102  
... ... @@ -142,8 +142,8 @@
142 142  
143 143  Strategy:
144 144  
145 -* Tell Apache that ##/skins## and ##/resources## URLs (except for ##/resources/~*~*/*.gwtrpc## ones) are served statically so that they don't go through the Servlet container
146 -* Configure ##web.xml## so that ##/*## URLs go through the Struts Servlet and so that ##/resources/~*~*/*.gwtrpc## URLs go through the GWT Servlet
145 +* Tell Apache that ##/skins## and ##/resources## URLs (except for ##/resources/~*~*/*.gwtrpc## ones in XWiki <9.7RC1) are served statically so that they don't go through the Servlet container
146 +* Configure ##web.xml## so that ##/*## URLs go through the Struts Servlet and (for XWiki <9.7RC1) so that ##/resources/~*~*/*.gwtrpc## URLs go through the GWT Servlet
147 147  * Tell XWiki to not generate URLs with ##bin## in the path
148 148  
149 149  Configuration steps:
... ... @@ -171,7 +171,7 @@
171 171  </servlet-mapping>
172 172  {{/code}}
173 173  )))
174 -* Edit ##web.xml## and replace the existing mapping:(((
174 +* For XWiki <9.7RC1 edit ##web.xml## and replace the existing mapping:(((
175 175  {{code language="xml"}}
176 176  <servlet-mapping>
177 177   <servlet-name>gwtrpc</servlet-name>

Get Connected