Last modified: 2013-11-21 15:04:51 UTC
With Javascript disabled/not available: *Links to sections, e.g. [[Albatross#Biology]] work correctly *Links to sections via a redirect, e.g. [[Beiruit#History]] work correctly ([[Beiruit]] is a redirect to [[Beirut]]). *Links to sections via a redirect to a section, e.g. [[Camden Market Fire]] takes you to the top of the target page but no the section ([[Camden Market Fire]]is a redirect to [[Camden Market#2008 Camden Market fire]] Fixing this may partially fix the section links issue in Bug 51122
If redirects where resolved at the URL level, this would be trivial (we'd include the fragment in the 301 or 302 Location header). However since MediaWiki doesn't do that, there is no way that I know of to automatically skip to a section without javascript. Example: Page [[Knight 4000]] is a redirect to section "Knight 4000" on page [[KITT#Knight_4000]] When linking to it from within a page like "[[Knight 4000]]" it renders as <a href="./Knight_4000">. One could wonder why this isn't resolved server-side, but I imagine it has to do with caching (the redirect target can change, and the article linking to it would have to be purged). When accessing it directly by url (/wiki/Knight_4000) the server doesn't redirect with 301 or 302, instead it responds normally with the content of the redirect target ([[KITT]] in this case) and the redirectToFragment javascript jumps to the correct section). Note that redirect pages do contain a <link rel=canonical> to avoid these from being indexed as duplicate entries. So possible solutions: * When accessed directly, do a proper 301 or 302 redirect instead of target content with <link rel=canonical> * Or; if the above is infeasible or undesired: Have the MediaWiki parser resolve links inside a page to the redirect target (naturally including the fragment), so that [[Knight 4000]] would result in <a href="./KITT#Knight_4000"></a> instead of <a href="./Knight_4000"></a>. However this is likely even less feasible as that would require us to purge all pages that link to a redirect when the redirect is edited
(In reply to comment #1) > So possible solutions: > > * When accessed directly, do a proper 301 or 302 redirect instead of target > content with <link rel=canonical> Not going to happen; see bug 18883. This would make it impossible to include the "(Redirected from $1)" message. So perhaps the best we can do is to add a new "(Redirected from $1 to section $2)" message, so the user can at least know what section was supposed to scroll into view, and quickly jump to that section.