Topic on Extension talk:NamespacePaths

Cristal01 (talkcontribs)

Hi,

@Dantman

Could you provide an example how to configure this extension? What to put in $wgNamespacePaths and htaccess? I'm not exactly a programmer but I need an extension like that and I can't figure it out myself.

Kghbln (talkcontribs)

Interesting question. I'd e.g. go for this:

LocalSettings.php
$wgArticlePath = "/wiki/$1";

$wgNamespacePaths = [
	NS_FILE => "/wiki/file/$1",
	NS_HELP => "/wiki/help/$1"
];
.htaccess
<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteRule ^/?wiki/file(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
	RewriteRule ^/?wiki/help(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
	RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
	RewriteRule ^/?$ %{DOCUMENT_ROOT}/w/index.php [L]
</IfModule>

If this is not working I do not know. Still Dantman may comment. :)

Reply to "Configuration"