Last modified by superadmin on 2026/11/25 21:36

Show last authors
1 1. Serve ##/skins## and ##/resources## from Apache so that they never reach the servlet container, pointing the aliases at your own exploded XWiki web application (##webapps/ROOT## on Tomcat).(((
2 {{code language="apache"}}
3 Alias /skins /usr/local/xwiki/skins
4 Alias /resources /usr/local/xwiki/resources
5
6 RewriteEngine on
7
8 RewriteRule ^/+skins - [L]
9 RewriteRule ^/+resources($|/.*) - [L]
10 {{/code}}
11 )))
12 1. Proxy every other request to XWiki, replacing ##localhost:8080## with your own servlet container address.(((
13 {{code language="apache"}}
14 ## The container redirects the browser for "/", so proxy it straight to the home page instead.
15 RewriteRule ^/*$ http://localhost:8080/Main/ [P,L]
16 ## Everything else goes to the servlet container.
17 RewriteRule .* http://localhost:8080%{REQUEST_URI} [P,L]
18
19 ProxyPassReverse / http://localhost:8080/
20 {{/code}}
21 )))
22 1. Map the ##action## servlet to ##/*## in ##WEB-INF/web.xml##.(((
23 {{code language="xml"}}
24 <servlet-mapping>
25 <servlet-name>action</servlet-name>
26 <url-pattern>/*</url-pattern>
27 </servlet-mapping>
28 {{/code}}
29 )))
30 1. Set ##xwiki.defaultservletpath## to an empty value in ##xwiki.cfg##, the key described with its ##xwiki.properties## counterpart on [[URL Configuration Properties>>doc:documentation.xs.admin.urls.short-urls.properties.WebHome]].(((
31 {{code language="none"}}
32 xwiki.defaultservletpath=
33 {{/code}}
34 )))
35 1. Restart Apache and XWiki.
36 1. Open any page and read its URL. The servlet mapping is gone, and the home page is reached without a redirect the browser can see.(((
37 {{code language="none"}}
38 before http://server.com/bin/view/Sandbox/WebHome
39 after http://server.com/view/Sandbox/WebHome
40 after http://server.com/ shows Main.WebHome
41 {{/code}}
42 )))

Get Connected