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

Daniel Friesen lists at nadir-seen-fire.com
Wed Aug 17 01:42:49 UTC 2011


It was a small project so my boss let me spend a few hours implementing
this.

MediaWiki 1.19 now has a few extra hooks that make altering the title
extraction pattern possible from extensions.
I added a NamespacePaths extension that should do what you want.
http://www.mediawiki.org/wiki/Extension:NamespacePaths

You should be able to backport the changes made in r94373 to your own
copy of MediaWiki and install the extension.
You'll have to patch one or two versions of MediaWiki with a small set
of hooks, but when you get to 1.19 you won't need to anymore.

For the .htaccess stuff, just rewrite things to your /index.php and the
REQUEST_URI extracting code will handle the rest.

~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]
~Redwerks: http://redwerks.org/

On 11-04-06 04:35 PM, Dorem - Jérémie Bouillon wrote:
> Kind of a newbie question... I'm not even sure of the appropriate 
> taxonomy for my request, maybe that's why Google didn't help.
>
> Using last stable (1.16.2 I believe), I'm trying to achieve this:
>
> Got a default setup, Mediawiki installed in /w, Apache conf edited with 
> an Alias. So now my wiki is accessible at http://domain.tld/wiki/
>
> 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
>
> And if Apache could rewrite on the client side /wiki/Bar:SomePage into 
> /Bar/SomePage that would be even better, albeit not a deal breaker.
>
> Without breaking anything in MW of course. And if the Recent or Search 
> tool return the Bar:SomePage that's not an issue, I don't want to 
> rewrite the MW core :)
>
> Anyone got an idea?



More information about the MediaWiki-l mailing list