Last modified: 2014-10-30 20:19:26 UTC
There's no way to create a page with an underscore in its title. Underscores are treated incorrectly because 1) Spaces in titles are encoded as underscores 2) There's no way to "escape" an underscore. Hence, here are a few example of epic fails: 1) In a page, write [[My_New_Page]] => this will be rendered as a link that reads My_New_Page which links to creating a page 2) click the link, edit and save the page 3) Now in the original page, write [[My New Page]] expected: the title of the saved page should be "My_New_Page". This page should be distinguishable from a page whose title is "My New Page". The link [[My New Page]] should link to a still-to-be-created page titled "My New Page" which would not be the same as "My_New_Page". If at all needed, a mechanism for escaping undersores should be provided. observed: the page that you create as "My_New_page" is actually saved as a page whose title is "My New Page". Both [[My_New_page]] and [[My New Page]] link to the same page, which is titled "My New Page". There's no such thing as a page with underscores in the title, and that's wrong. If you try to rename (i.e. move) the page "My New Page" to "My_New_Page", it will issue an error saying a page cannot be moved onto itself.
This is the expected behavior. You can use the DISPLAYTITLE: parser function to override the displayed page title, for example to display it with underscores instead of spaces. Currently this only affects the page heading and title, there's a feature request for this modified title to be used consistently everywhere (bug 24139). {{DISPLAYTITLE:My_New_Page}} https://www.mediawiki.org/wiki/Help:Magic_words#Displaytitle (For a practical example, see e.g. [[mod_perl]] on the English Wikipedia.)
Good to know there's a workaround, but it's still a wrong approach. Also note that if you still want to maintain this approach (i.e. considering "_" and " " as the same character in titles), then at the very least a warning should be given when creating a page. Yeah, that's not trivial, because when the page is actually created there's almost no way to "know" the link that lead to its creation had an underscore. Which shows once more that the approach is wrong in the first place.