How do Wikipedia (or MediaWiki in general) encode page titles in URIs? It’s not normal URI encoding, since spaces are replaced with underscores and double quotes are not encoded and things like that.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
http://en.wikipedia.org/wiki/Wikipedia:Naming_conventions_%28technical_restrictions%29 – here you’ve got some kind of description of what their engine enforces on article names.
They should have something like this in their LocalSettings.php:
$wgArticlePath = ‘/wiki/$1’;
and proper server URI rewrites configuration – they seem to be using Apache (HTTP header), so it’s probably mod_rewrite. http://www.mediawiki.org/wiki/Manual:Short_URL
You can also refer to the index.php file for an article on Wikipedia like this:
http://en.wikipedia.org/w/index.php?title=Foo%20barand get redirected by the engine tohttp://en.wikipedia.org/wiki/Foo_bar. Behind the scenes mod_rewrite translates it into /index.php?title=Foo_bar. For the MediaWiki engine it’s the same as if you visitedhttp://en.wikipedia.org/w/index.php?title=Foo_bar– this page doesn’t redirect you.