On Thu, Feb 26, 2009 at 10:42 PM, Angela beesley@gmail.com wrote:
No, it's possible to add "redirected from" but still change the URL. Wikia did this before the canonical tag came in.
The code is here: https://svn.wikia-code.com/wikia/trunk/extensions/wikia/HardRedirectsWithJSText/HardRedirectsWithJSText.php
That's not a method I'd seen before. It's quite clever, and it looks like it actually doesn't need JavaScript at all. The basic idea is to set a cookie when sending the 301, and then check for the cookie on the actual page display (and unset it immediately). This would only fail for users with cookies disabled, and those users couldn't log in anyway (perhaps they could edit anonymously, I guess). The cookie could contain both the redirect and the target page names, so it wouldn't add bogus redirect messages if the user loads multiple pages at once.
Of course, the Wikia implementation requires JavaScript to be enabled. (Wikia appears to view this as a much smaller cost than MediaWiki developers do.) I don't think that's actually necessary at all, though. Just read the cookie in PHP. It would take considerably more effort to implement this properly in core than the current "canonical" workaround, but it might be worth doing at some point, unless there's a problem I'm missing.
. . . anyway, my point was just that the situation in question is different from redirects, which it is, regardless of the above (although the info you give is interesting).
On Fri, Feb 27, 2009 at 5:09 AM, Ilmari Karonen nospam@vyznev.net wrote:
The actual semantic difference between 301 and 302, as Oldak notes, is that clients that can choose which URL to use in the future should prefer the redirect target for 301, whereas they should keep using the original URL for 302.
(There's also some differences with cacheability by default, but explicit expiry and cache control headers override those.)
Reviewing the definitions, I guess you're right. A 302 with appropriate caching headers seems slightly more appropriate. I don't think it's a big deal, though.
On Fri, Feb 27, 2009 at 6:24 AM, Tei oscar.vives@gmail.com wrote:
And If you visit this: en.wikipedia.org./Main_Page
It works (with a HTML redirection), but you are amused with a page designed to scare you.
It seems work with other words: http://en.wikipedia.org./Cool
It's designed to scare you because that type of URL will only work in the majority of cases, not all cases. Try these URLs:
http://en.wikipedia.org/w http://en.wikipedia.org/robots.txt
Of course, these still work:
http://en.wikipedia.org/W http://en.wikipedia.org/Robots.txt
And on enwiki, pages starting with lowercase letters happen to be prohibited at the moment. But there'd be no way to access [[wikt:w]] or [[wikt:wiki]] with this kind of URL, for instance, and trying to access [[w:w]] could cause confusion (you have to make sure to uppercase the first letter of the URL). So we use scary/annoying messages to discourage people from using this type of URL with the intent that it actually work in all cases.