Last modified: 2012-01-06 23:32:50 UTC
Setting "$wgDebugRedirects = true" in "LocalSettings.php" does not work as it described by the documentation: http://www.mediawiki.org/wiki/Manual:$wgDebugRedirects If redirected page is accessed using original URL, the redirect still happens automatically. It is either (1) problem with the code or (2) lack of explanation in documentation. STEPS TO REPRODUCE: 1. I have a MediaWiki instance installed into (similar) URL: http://example.com/content/ 2. I created a page which is directly accessible through: http://example.com/content/index.php?title=Initial 3. Then I redirected (moved leaving a redirect) the page giving it new name: http://example.com/content/index.php?title=Moved 4. Then I enabled ("$wgDebugRedirects = true;" in LocalSettings.php) the feature to disable automatic redirects. According to the documentation, this should disable redirects and show new location instead. 4.1 EXPECTED RESULT: In the example above, when I enter the first URL, the wiki engine should not show content of the page. It should simply show a some kind of auto-message with a link to the new "Moved" page. 4.2 OBSERVED RESULT: When the first URL is used, the wiki engine still redirects the page showing its content. In other words, it behaves as if there were no changes to "$wgDebugRedirects" variable.
The case you describe isn't actually a redirection. The setting only affects real HTTP redirects.
Niklas, let me elaborate on this as I understand it. If the following is correct, the bug can be closed. But I think documentation should be clarified then. What I was trying to do is to disable the "Wiki logic level" redirects. --- HTTP level The "$wgDebugRedirects" variable controls the action when MediaWiki is about to generate 301 HTTP reply: * When "$wgDebugRedirects = false" (default), it actually generates HTTP 301 reply to trigger redirection. * When "$wgDebugRedirects = true", it generates regular HTTP 200 reply (success) providing web page with link. --- Wiki logic level Word "redirect" in MediaWiki has additional meaning: provide content of the page normally accessed through a different name. In the case of such redirect, no HTTP 301 reply is attempted, and MediaWiki simply provides content of another page right away using HTTP 200 reply.
Documentation clarified (yay its a wiki!)