[Mediawiki-l] Short URL using rewriterule without rename wiki to w

Krinkle krinklemail at gmail.com
Mon May 28 01:17:47 UTC 2012

On Mon, May 28, 2012 at 2:57 AM, Chee-Yang Chau <cychau at gmail.com> wrote:

> I found the solution, in .htaccess:
> RewriteEngine On
> RewriteCond %{SCRIPT_FILENAME} -f [OR]
> RewriteCond %{SCRIPT_FILENAME} -d
> RewriteRule .* - [L]
> RewriteRule ^wiki/(.+)$ wiki/index.php/$1 [L,QSA]
This means you can't have articles with any of these names:

* [[bin]]
* [[docs]]
* [[extensions]]
* [[images]]
* [[languages]]
* [[FAQ]]
* [[Maintenance]]
* [[Tests]]

..and maybe more.

As documented [1], you should never use the same name for a virtual
directory and a real directory. Rename your /wiki/ directory to /mw, /w/ or
/mediawiki or whatever. Then use /wiki/$1 as the article path that readers
will see.

Then there are no conflicts.

-- Krinkle

[1] https://www.mediawiki.org/wiki/Manual:Short_URL

More information about the MediaWiki-l mailing list