Page MenuHomePhabricator

Enable short url
Closed, ResolvedPublic

Description

All pages now have urls according to the pattern /mediawiki/index.php?title=Samsyn:Kategorier, conventionally they can also be accessed as /wiki/Samsyn:Kategorier.

How to set this up is described in mw:Manual:Short_URL.

Related Objects

StatusSubtypeAssignedTask
ResolvedLokal_Profil
ResolvedLokal_Profil

Event Timeline

The corresponding instruction page seems to be https://www.mediawiki.org/wiki/Manual:Short_URL/IIS8.5 (with w/ changed to mediawiki/ (unless lots have changed between IIS8.5 and IIS10.0.

We should also find the IIS equivalent of RewriteRule ^/*$ %{DOCUMENT_ROOT}/mediawiki/index.php [L] (see this instruction) to ensure no one ends up at the IIS landing page anymore.

We should also find the IIS equivalent of RewriteRule ^/*$ %{DOCUMENT_ROOT}/mediawiki/index.php [L] (see this instruction) to ensure no one ends up at the IIS landing page anymore.

Done in T185879#4007701 and now documented on mediawiki.org

I got this to work by adding the following rule to web.config

<rule name="UserFriendlyUrl">
    <match url="^wiki/(.*)$" ignoreCase="false" />
    <conditions>
        <add input="{URL}" pattern="mediawiki/(.*)" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    </conditions>
    <action type="Rewrite" url="mediawiki/index.php?title={R:1}" logRewrittenUrl="true" />
</rule>

The complication arises from our choice of scriptpath mediawiki/ which will also match a wiki/ pattern.

Note that switching to/from mobile view using the link in the bottom will still take you to a /mediawiki/ url. But following any internal link takes you back to /wiki/