Skip to content

Instantly share code, notes, and snippets.

@alindgren
Created November 1, 2016 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alindgren/152d6c3d929e62597431ed6f56b9af5d to your computer and use it in GitHub Desktop.
Save alindgren/152d6c3d929e62597431ed6f56b9af5d to your computer and use it in GitHub Desktop.
Canonical domain redirect for Umbraco Cloud sites

Sebastiaan Janssen has stated that content deploys might not work on Umbraco Cloud if you redirect /umbraco/*.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="canonical" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www\.domain\.com$" negate="true" />
<add input="{REQUEST_URI}" negate="true" pattern="^/umbraco" />
</conditions>
<action type="Redirect" url="https://www.domain.com/{R:0}" appendQueryString="true" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment