Umbraco Cloud: URL Rewrites
# help-with-umbraco
a
Any URL Rewrite experts up in here? I have a request from a customer to reduce their redirect chain. I've created the following Rewriterule:
Copy code
<rule name="HTTP to HTTPS and Normalize Domains" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions logicalGrouping="MatchAny">
                        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                        <add input="{HTTP_HOST}" pattern="^www\.(.+)$" ignoreCase="true" />
                        <add input="{HTTP_HOST}" pattern="^sub\.domain\.dk$" ignoreCase="true" />
                    </conditions>
                    <action type="Redirect" url="https://fulldomain.dk/{R:1}" redirectType="Permanent" />
                </rule>
The site has the follong domains sub.domain.dk and fulldomain.dk I get the chain when i request http://sub.domain.dk -> https://sub.domain.dk -> https://www.fulldomain.dk -> https://fulldomain.dk Now I expected, with my above rule, that it would jump directly from http://sub.domain.dk -> https://fulldomain.dk But I also don't see any certificate for sub.domain.dk or similar registered on cloud, so could my client have configured the dns for domain.dk somewhere else, or am i missing something else entirely?
c
Yeah - if you check the DNS for
sub.domain.dk
it should go to the Cloud IP for that to work - which also means that there should be a
sub.domain.dk
hostname set in the portal. Otherwise, the Cloud server never sees the subdomain request.
a
thanks a bunch @Chriztian Steinmeier perfect idea. sub.domain.dk indeed does point to a differnent IP