Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Keith R Hubbard 175 posts 403 karma points
    Jun 15, 2019 @ 21:58
    Keith R Hubbard
    0

    Url Rewrite rules on Umbraco Cloud for two domain names

    I have two Domain Names. https://www.passscriptsourcing.com and https://www.gopassrx.com. the client just gopassrx.com. On Umbraco cloud in hostnames I get a vague Rewrites error shown below.

    Rewrites Error

    I have followed the documentation and tried a few Rewrites.

    <rule name="Canonical Host Name" stopProcessing="true">
                <match url="(.*)" />
                <conditions>
                    <add input="{HTTP_HOST}" negate="true" pattern="https://passscriptsourcing.com" />
                </conditions>
                <action type="Redirect" url="https://gopassrx.com/{R:1}" redirectType="Permanent" />
            </rule>
            <rule name="Redirect to HTTPS" stopProcessing="true">
            <match url="(.*)" />
            <conditions>
                <add input="{HTTPS}" pattern="^OFF$" />
                </conditions>
                <action type="Redirect" url="https://www.passscriptsourcing.com/{R:0}" redirectType="Permanent" />
            </rule>
    <rule name="Redirect to HTTPS" stopProcessing="true">
        <match url="(.*)" />
            <conditions>
            <add input="{HTTPS}" pattern="^OFF$" />
            </conditions>
            <action type="Redirect" url="https://www.gopassrx.com/{R:0}" redirectType="Permanent" />
    </rule>
    

    When i go to Https://gopassrx.com

    I get the following error.

    gopassrx security error

    I need both domains to work. Are there any rewrite guru's out there?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 16, 2019 @ 08:58
    Dirk De Grave
    0

    for what it's worth, ran into exactly the same issue yesterday/today adding a domain name for a site (which is not yet live, but that's another point) and i believe it can take up some time before the propagation of the cname record is ready. Docs says you should first create a cname record to point your domain name to [alias]..s1.umbraco.io, then add the domain name in the cloud portal. Did that, did 3 tries yesterday, ran into that error message. Did it again this morning (cname record was created yesterday) and now domain is correctly protected by latch.... so assuming it might take some time... not sure if this will help you, but worth a try?

    --Dirk

  • Søren Gregersen 441 posts 1884 karma points MVP 2x c-trib
    Jun 16, 2019 @ 13:57
    Søren Gregersen
    0

    Hi,

    Regarding your rules, you should have a read of https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/url-rewrite-module-configuration-reference

    An example:

     <conditions>
                <add input="{HTTP_HOST}" negate="true" pattern="https://" />
    </conditions>
    

    This condition will never work, since HTTP_HOST only contains the host, not the protocol.

    Also, the rules point to both domains with www and without. All domains should be in the hostnames list, otherwise umbraco cloud won't know that the domain should point to your site.

  • Keith R Hubbard 175 posts 403 karma points
    Jun 17, 2019 @ 14:20
    Keith R Hubbard
    0

    I updated with no luck

    <rule name="Redirect to HTTPS" stopProcessing="true">
        <match url="(.*)" />
            <conditions>
            <add input="{HTTP_HOST}" negate="true" pattern="https://" />
            </conditions>
            <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
        </rule>
    
  • Keith R Hubbard 175 posts 403 karma points
    Jun 18, 2019 @ 04:03
    Keith R Hubbard
    100

    This was resolved by using the following.

    <rule name="HTTP to HTTPS redirect" stopProcessing="true">
    <match url="(.*)" />
    <conditions>  
    <add input="{HTTPS}" pattern="off" ignoreCase="true" />
    <add input="{HTTP_HOST}" pattern="localhost" negate="true" />
    <add input="{REQUEST_URI}" negate="true" pattern="^/.well-known/acme-challenge" />
    </conditions>
    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
    </rule>
    

    For what is worth. I deleted the hostname in the hostnames section and then pasted the above code in the web.config. I then added the hostname and Latch initialized.

Please Sign in or register to post replies

Write your reply to:

Draft