[Mediawiki-l] rewrite of URL
Hugh Prior
mediawiki at localpin.com
Tue May 16 14:26:28 UTC 2006
I am trying to eliminate the "index.php" from my website as described in:
http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url
in the subsection "Using a rewrite rule in a .htaccess file".
Basically I would like the same illusion of article names being under a
"wiki" directory that www.wikipedia.org manages.
The "real" software I have put in a "mw" directory, and I want it to look
like it is always the format "wiki/Article_name"
To some degree it works, since I can surf to:
http://www.chainki.com/wiki/Main_Page
but the link to [[My test]] page goes to:
http://www.chainki.com/mw/index.php?title=My_test
(this has 2 errors: 1) it shows the "mw", and 2) it shows the "index.php"
file
while the navigation bar goes to "wiki" but shows the "index.php", e.g.
http://www.chainki.com/wiki/index.php?title=Chainki:Community_Portal
Am I expecting too much of this method? Can you see what I am doing wrong?
Thanks.
.htaccess is as follows:
------------------------------------------------------
php_flag register_globals off
RewriteEngine on
RewriteRule ^/$ /wiki/Main_Page [R]
RewriteRule ^wiki/?(.*)$ /mw/index.php?title=$1 [L,QSA]
------------------------------------------------------
In LocalSettings.php I have set:
$wgArticlePath = "/wiki/$1";
More information about the MediaWiki-l
mailing list