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

Dorem - Jérémie Bouillon jeremie at dorem.info
Fri Jul 29 00:34:41 UTC 2011


On 29/07/2011 01:04, Platonides wrote:
> It's the wiki doing it for you. Don't link to /wiki/ since it redirects
> to /wiki/Main_Page
>
> For your .htaccess
> RewriteEngine on
> RewriteRule ^doc/$ /w/index.php?title=Docs:Documentation_index [L]
> RewriteRule ^doc/(.*)$ /w/index.php?title=Docs:$1 [L]

Thanks a lot, but it loops on the NS index.

I got this:

RewriteRule ^documentation/$ /w/index.php?title=Docs:Documentation_index [L]
RewriteRule ^documentation/(.*)$ /w/index.php?title=Docs:$1 [L]

Works for every page, except Accueil (which is Main_page in French 
Mediawiki).

http://domain.tld/documentation/Accueil
or
http://domain.tld/documentation/

is rewritten to 
http://domain.tld/documentation/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/

It seems to come from MW, since Apache does not log an error (not even a 
404, nor a loop). It's MW that says 
"Documentation:Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/Accueil/" 
does not exist, would you like to create it, and so on.

I tried to look the MW manual for Namespace_index command, see how its 
handled, no luck.



More information about the MediaWiki-l mailing list