If I try to access a page on my MediaWiki, with a URL such as:
http://www.mywiki.com/some_page#a_section_of_some_page
the URL gets truncated to:
http://www.mywiki.com/some_page
I am running in IIS and using short URLs. In my LocalSettings.php, I have
$wgScriptPath = "";
$wgScriptExtension = ".php";
$wgArticlePath = "${wgScriptPath}/$1";
$wgServer = "https://www.mywiki.com";
$wgUsePathInfo = false;
I have a rule in my web.config like this:
<rule name="wwwroot">
<match url="^(.*)$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?title={UrlEncode:{R:1}}" />
</rule>
I just wrapped the capture group in UrlEncode, but obviously it is not working. Also, oddly enough in the blink of an eye when I click a external link to
http://www.mywiki.com/some_page#a_section_of_some_page
I can see the browser go to the correct page, but then "#a_section_of_some_page" gets stripped out of the URL and the browser redirects to the top level page.