-
Notifications
You must be signed in to change notification settings - Fork 0
/
Latch.Web.live.xdt.config
33 lines (31 loc) · 1.88 KB
/
Latch.Web.live.xdt.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?xml version="1.0"?>
<!--
This is the default Umbraco Cloud Latch transform file - It is used to ensure that the live site will be running
via https and force redirects from http to https.
It does so by setting the "umbracoUseSSL" setting to true, which will tell the Umbraco Backoffice to serve URLs via https
and it adds a redirect rule that will force the site to run via https, except for when running localhost.
To disable the forced https, simply remove this file from your repository. This is not advised, as all domains
on Umbraco Cloud will be running https, as a certificate will be issued for custom domains by the Latch feature,
and all [alias].s1.umbraco.io domains will already be protected.
For more info about how this file is working check: https://our.umbraco.com/documentation/Umbraco-Cloud/Set-Up/Config-Transforms/
Documentation for the redirect rule can be found on our: https://our.umbraco.com/documentation/Umbraco-Cloud/Set-up/Manage-Domains/Rewrites-on-Cloud/#running-your-site-on-https-only
-->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="Umbraco.Core.UseHttps" value="true" xdt:Transform="SetAttributes(value)" xdt:Locator="Match(key)" />
</appSettings>
<system.webServer>
<rewrite xdt:Transform="InsertIfMissing">
<rules xdt:Transform="InsertIfMissing">
<rule xdt:Transform="InsertIfMissing" xdt:Locator="Match(name)" name="Umbraco Cloud Latch Https redirect rule" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
<add input="{HTTP_HOST}" pattern="localhost" negate="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>