[Mediawiki-l] Different URL path for different namespace?

Brion Vibber brion at pobox.com
Thu Apr 7 00:07:32 UTC 2011

2011/4/6 Dorem - Jérémie Bouillon <jeremie at dorem.info>

> I would like to link a specific namespace (let's say "bar") to its own
> URL, outside of /foo/.
> Ok, to rephrase, hopefully better:
> I would like:
> domain.tld/wiki/Bar:SomePage
> to be in fact:
> domain.tld/Bar/SomePage

I think the best way to do this would be to whip up an extension using the
'GetLocalURL' hook to change the URLs that MediaWiki outputs when they look
clean (no extra query params etc).

Setting up Apache rewrite rules to translate your custom URLs back to
index.php?title=Blah form should handle the other side of things, so
MediaWiki understands the incoming URLs.

For general info on extensions & writing them see:
http://www.mediawiki.org/wiki/Manual:Extensions and
http://www.mediawiki.org/wiki/Manual:Developing_extensions -- a simple
extension can just be one function so it's not too intimidating really. :)

-- brion

More information about the MediaWiki-l mailing list