Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions script/redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,20 @@ function buildRedirects() {
<action type="Redirect" url="https://{C:2}/{R:1}" redirectType="Permanent" />
</rule>
<!--END SSL-->
<!--BEGIN Bracket-in-URL proxy - must come before trailing slash rule -->
<!-- The domain should match the catch-all route defined in redirects.json -->
<rule name="Bracket-in-URL proxy" stopProcessing="true">
<match url="^(.*)\\[([^\\]]+)\\](.*)$" ignoreCase="true" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(?:www.)?(.*)$" />
</conditions>
<action type="Rewrite" url="https://primer-docs-preview.github.com{UNENCODED_URL}" appendQueryString="false" />
<serverVariables>
<set name="HTTP_X_UNPROXIED_URL" value="https://primer-docs-preview.github.com{UNENCODED_URL}" />
<set name="HTTP_X_ORIGINAL_HOST" value="{HTTP_HOST}" />
</serverVariables>
</rule>
<!--END Bracket-in-URL proxy -->
<!--BEGIN Trailing slash enforcement-->
<rule name="Add trailing slash" stopProcessing="true">
<match url="(.*[^/])$" />
Expand Down
Loading