Last modified: 2012-06-06 18:38:06 UTC
Please keep the given anchor on Special:PermanentLink.
The wikilink [[Special:PermanentLink/1#test]] gives
Seems to work for me...
When I follow <https://en.wikipedia.org/wiki/Special:PermanentLink/1#test> I end up at <https://en.wikipedia.org/w/index.php?oldid=1#test>
Same seems to work on a local wiki install, both trunk and 1.18.
Tested in Firefox 7.0.1.
I am using IE8, but works in Firefox 4.0 on my machine.
I can confirm that IE8 on WinXP behaves as described above (drops the #test).
Looking at the code for Special:PermanentLink it looks like the replacement of the #test is actually something that Firefox is doing explicitly in the browser side...
Hash fragments are not actually sent to the server, so the server-side processing has no way to know if there is one or not. It just empties out the existing parameters and replaces them with an 'oldid' param set to whatever the subpage parameter was.
So when you go to <http://en.wikipedia.org/wiki/Special:Permalink/1#test>
MediaWiki sees that you went to "/wiki/Special:Permalink/1". It sends you back to "/wiki/index.php?oldid=1".
Your browser may then be smart enough to say "maybe you wanted to keep that #test on the redirected URL?" and add it on... but MediaWiki never saw it in the first place.
(In reply to comment #3)
> Only way to fix this as a general case I can think of would be to redo it to
> navigating over to the target page.
A media: style special case where the parser sees Special:Permalink and a # and gives the /index.php url directly would be a tolerable hack if the alternative is turning a HTTP redirect into a page that uses JS.
The browser (IE8) is not showing the anchor, but jumping to the section, so all is good.