[xwiki-users] [xwiki] Clean URLs - Anyone knows why we have /bin/ in XWiki URLs?
Sergiu Dumitriu
sergiu at xwiki.com
Fri Dec 21 14:09:14 CET 2007
Paul Libbrecht wrote:
> Hello List,
>
> has there been any progress on that ?
> I can attest that, at least out of the box, expanding the XWiki webapp
> into the ROOT directory gives rather disatrous effects (i.e. still loads
> of paths that are /xwiki/....).
>
> It would be nice to have a rewrite engine but this has to work to ways,
> i.e. if I drag-and-drop a link produced by XWiki it should the short URL
> that one wishes and not one that is also compatible (but, e.g., is very
> long).
>
> thanks for hints. It is most probable by now that we shall build the
> intergeo platform on xwiki and curriki...
>
> paul
>
If you deploy XWiki as the ROOT app, you must also change in
WEB-INF/web.xml the <display-name> parameter to the empty string, like:
<display-name></display-name>
To get rid of /view/, in xwiki.cfg write
xwiki.showviewaction=0
To get rid of /bin/, for the moment you have to change web.xml in a
container-dependent way, so that you map the container's default servlet
to existing directories, like skins, yui, tinymce and wikieditor, copy
the /bin mapping to also be activated for / (copy, don't change, so that
/bin works, too), then add in xwiki.cfg
xwiki.defaultactionpath=
This will allow you to access documents with server.com/Space/Document,
server.com/Space/ (pointing to Space.WebHome), server.com/Document
(pointing to Main.Document), and server.com/ will show Main.WebHome
without needing a redirect.
As a bonus, these changes are backwards compatible, meaning that any
currently working URL will also work with these changes performed, so
you won't have any broken bookmarks.
All these changes aren't completely tested, so there could be some
things that aren't working, because of code that parses the URL and
counts the number of slashes, or expects an exact URL pattern containing
/bin/ or stuff like that. But my unconfirmed guess is that it should all
work fine.
If you want to have different action mappings, like
server.com/Space/Doc?action=edit, then there's more work, like writing a
new URLFactory, changing struts-config.xml, and creating another
RequestProcessor.
Sergiu
More information about the users
mailing list