Hi,
yesterday I'v set up a new wiki (with the new Milestone 2).
I've followed the instructions to set up short urls:
http://platform.xwiki.org/xwiki/bin/view/Main/ShortURLs
with one difference. Instead of using mod_redirect for the Apache HTTPD
I'm using mod_proxy and mod_rewrite so that an url
www.mydomain.com/docs -> (internal-ip) 192.168.1.n/appContext
The effect is that from the internet only the new naming schema is
visible and not the default 'long' url resolution.
This works fine so far, except for one issue:
In all cases where xwiki generates redirection urls like this example
for "Logout"
/docs/logout/XWiki/XWikiLogout?xredirect=http://www.mydomain.com/appContext/docs/XWik/aha
What's wrong IMHO is "appContext" - part of the ?xredirect - this
exposes the internal webapppath back to the caller.
I have configured the xwiki.cfg to not using the appPath:
xwiki.webapppath=/ but this setting is not used,
instead the deployment webappPath is used for ?xredirect.
In all other cases (except the ?xredirect) the configured webapppath
seems to be used correctly.
This is my configuration:
in xwiki.cfg:
xwiki.webapppath=/ (because this is handled by mod_rewrite)
xwiki.defaultservletpath=docs/ (use "docs" instead of "bin")
xwik.showviewaction=0
in web.xml
param-value of "redirectHomeServlet" to
http://www.mydomain.com/docs/Main
and added a <servlet-mapping> pattern for "action" to /docs/*
for completeness here's the mod_rewrite <VirtualHost> configuration (Ubuntu)
<VirtualHost *>
ServerName
www.mydomain.com
ServerAdmin wiki(a)mydomain.com
RewriteEngine On
RewriteLog /var/log/wiki_rewrite.log
RewriteLogLevel 2
CustomLog /var/log/wiki_custom.log common
ErrorLog /var/log/wiki_error.log
# use [P] for Proxy and NOT [R] for redirect !
RewriteRule ^/(.*)
http://www.mydomain.com/appContext/$1
[L,P,E=proxy_ok:1]
ProxyPreserveHost On
</VirtualHost>
and this is the mod_proxy
<IfModule mod_proxy.c>
#turning ProxyRequests on and allowing proxying from all may allow
#spammers to use your proxy to send email.
ProxyRequests Off
<Proxy *>
AddDefaultCharset off
Order deny,allow
Deny from all
# Proxies just in case Proxy_ok is set
Allow from env=proxy_ok
</Proxy>
# Not sure whether we need this ...
# Enable/disable the handling of HTTP/1.1 "Via:" headers.
# ("Full" adds the server version; "Block" removes all
outgoing
Via: headers)
# Set to one of: Off | On | Full | Block
ProxyVia On
</IfModule>
thanks for your support
Andreas