User talk:MikeMol

From Rosetta Code
Revision as of 02:30, 26 February 2008 by MikeMol (talk | contribs) (One last link)

re: Welcome

C++ linking broken again

Links to C++ seem to have broken again. Was there another Mediawiki upgrade that broke this? --IanOsgood 10:35, 7 February 2008 (MST)

No...But I did switch to clean URLS, which might have broken it. I'll have to look at it tonight. --Short Circuit 10:50, 7 February 2008 (MST)
Looks like mod_rewrite might be parsing + as space, which is valid. But something causes it to parse %2B as a space, which isn't valid. I might have to drop clean URLs to get good ++ behavior back. Later, though; I've got to go back to work. --Short Circuit 11:21, 7 February 2008 (MST)
Still broken. --IanOsgood 18:57, 22 February 2008 (MST)
Yeah. Short of dropping clean URLs, there's nothing I can do about it until Bluehost upgrades the Apache on my box. (By one measly revision, no less...) BTW...You should stop by #rosettacode again some time.--Short Circuit 19:12, 22 February 2008 (MST)

It only works on edit pages. badLanguage++ works fine.--Mwn3d 09:33, 25 February 2008 (MST)

When you edit pages (Say, PageTitle, the URL looks something like http://www.rosettacode.org/w/index.php?title=PageTitle&action=edit. If you navigate to an existing page, however, the URL will look something like http://www.rosettacode.org/wiki/PageTitle. Apache's mod_rewrite rearranges the URL so that, to PHP--and thus MediaWiki--it looks like http://www.rosettacode.org/w/index.php?title=PageTitle.
The problem comes from the way mod_rewrite handles the symbol %2B when it does this rearrangement. If it worked correctly, mod_rewrite would leave it alone. The "clean" URL for the C++ category, http://www.rosettacode.org/wiki/Category:C%2B%2B, should be rewritten as http://www.rosettacode.org/w/index.php?title=Category:C%2B%2B. Instead, mod_rewrite incorrectly interprets the %2B and converts it to +, then replaces all consecutive +s with a single space, then, finally, erases all of the spaces at the end of the page title URL argument. So, ultimately, the clean URL for the C++ category gets rewritten as http://www.rosettacode.org/w/index.php?title=Category:C -- which is the category for C.
We thought we'd fixed the problem when I upgraded MediaWiki in November. In truth, what had happened was that in my rush to move Rosetta Code from Geekalize's server to my shared hosting account, I left out the mod_rewrite rules to enable clean URLs. So, suddenly, all of the pages with ++ in the title suddenly worked as they should. I didn't realize that it was related to my not bringing back clean URLs.
It turns out there's a workaround for the problem. According to the Apache changelogs an option to forgo escaping substitution (the mod_rewrite feature that's broken) was added to mod_rewrite in Apache 2.2.7, but the Bluehost server Rosetta Code runs on is running Apache 2.2.6. I talked with Bluehost support, and they're not able to move Rosetta Code to a server running a more recent version of Apache, nor are they able to give me a time estimate as to when Apache will be upgraded. So, right now, with this hosting, the only way to fix C++ would be to turn off clean URLs. For SEO, URL sharing and URL persistence reasons, I would rather leave the C++ category page broken than turn off clean URLs.
In addition, I'd really like to move Rosetta Code off of Bluehost. The Village Pump forum software fires off an email to me every time the server's database is unreachable. That seems to happen frequently. Getting on a better server is at the top of my wishlist right now, which is one major reason I want to get the Book project off the ground.
All of that said, it should be possible to work around the C++ in MediaWiki by having Template:header check for "C++", and use a direct link to http://rosettacode.org/w/index.php?title=Category:C%2B%2B instead of an interwiki link. The same type of fix could finally give us a portable solution to C#, as well. --Short Circuit 19:13, 25 February 2008 (MST)