How do I fix https warning when redirecting one domain to another domain using iis url rewrite?IIS7 URL Rewriting: How not to drop HTTPS protocol from rewritten URL?URL Rewrite to https on certain URLsIIS 8.5 URL Rewrite force redirect http --> https for non wwwWhat RegEx pattern to use for URL rewrite to redirect traffic to HTTPS, but not from a particular subdomain?How to redirect all non-www URLs to https://www. in IIS?IIS URL Rewrite - with multiple domainsUrl Rewrite - Web.config - HTTPS and wwwWeb.config URL Rewrites - HTTPS and Non-WWWURL rewrite to redirect all URL variants to https://www.example.comIIS URL Rewrite Http to Https, exclude single URL

Adjacent DEM color matching in QGIS

How to use dependency injection and avoid temporal coupling?

What are the differences between credential stuffing and password spraying?

Does the 7th major scale note resolve more strongly to the lower tonic (note 1) than the higher tonic (note 8)?

What does 'made on' mean here?

Are pressure-treated posts that have been submerged for a few days ruined?

Wrong answer from DSolve when solving a differential equation

Why aren't nationalizations in Russia described as socialist?

How to safely wipe a USB flash drive

How do inspiraling black holes get closer?

What is the solution to this metapuzzle from a university puzzling column?

Does it make sense for a function to return a rvalue reference

Can there be a single technologically advanced nation, in a continent full of non-technologically advanced nations?

Copy previous line to current line from text file

Can my company stop me from working overtime?

Did we get closer to another plane than we were supposed to, or was the pilot just protecting our delicate sensibilities?

Why do people keep telling me that I am a bad photographer?

In Russian, how do you idiomatically express the idea of the figurative "overnight"?

Word meaning as function of the composition of its phonemes

PWM 1Hz on solid state relay

How to adjust tikz picture so it fits to current size of a table cell?

Did the manned NASA capsules rotate during descent?

Should I mention being denied entry to UK due to a confusion in my Visa and Ticket bookings?

Find the cheapest shipping option based on item weight



How do I fix https warning when redirecting one domain to another domain using iis url rewrite?


IIS7 URL Rewriting: How not to drop HTTPS protocol from rewritten URL?URL Rewrite to https on certain URLsIIS 8.5 URL Rewrite force redirect http --> https for non wwwWhat RegEx pattern to use for URL rewrite to redirect traffic to HTTPS, but not from a particular subdomain?How to redirect all non-www URLs to https://www. in IIS?IIS URL Rewrite - with multiple domainsUrl Rewrite - Web.config - HTTPS and wwwWeb.config URL Rewrites - HTTPS and Non-WWWURL rewrite to redirect all URL variants to https://www.example.comIIS URL Rewrite Http to Https, exclude single URL






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I have two domains, one is shortened and is used when sending text messages with a query string because the regular domain is too long. Currently, a web page on a different IP address redirects the short domain to the long one, either to a particular page if it has the correct query string, or to the home page if it does not. I'm moving to Azure where I will have only one IP address. So I figured IIS URL Rewrite would be able to handle this task. Long domain is a HTTPS only site, and there is a HTTPS rule for it. Short domain is not; the links are always HTTP only. I've setup URL Rewrite to do the Redirects before the HTTPS rule and stopProcessing="true" is set for both rules. But when I visit http://mytxt.net, I get a browser warning that the SSL cert is invalid.



The server is Windows Server 2016 IIS 10. I've searched Google and Stack Oveflow specifically but haven't found anything matching my issue. Below is the code.



 <rule name="Txt QS Redirect" stopProcessing="true">
<match url="^(www.)?mytxt.net"/>
<conditions>
<add input="QUERY_STRING" pattern="^MyQS"/>
</conditions>
<action type="Redirect" url="https://www.myfullsite.net/respond.aspx" appendQueryString="true" redirectType="Temporary"/>
</rule>
<rule name="Txt No QS Redirect" stopProcessing="true">
<match url="^(www.)?mytxt.net"/>
<conditions trackAllCaptures="false">
<add input="QUERY_STRING" pattern="^MyQS" negate="true"/>
</conditions>
<action type="Redirect" url="https://www.myfullsite.net/" redirectType="Permanent"/>
</rule>
<rule name="HTTPS Redirect">
<match url="(.*)"/>
<conditions>
<add input="HTTPS" pattern="^OFF$"/>
</conditions>
<action type="Redirect" url="https://HTTP_HOST/R:1" redirectType="Permanent"/>
</rule>


Shouldn't the redirect happen first, and then the protocol change to HTTPS? Or are the browsers checking for SSL first, and when IIS says it is enabled, doing the protocol change on the client?










share|improve this question






















  • Your certificate must work with both domains or you have two SNI bindings for each of them. In short, https must work for both sites, before you create the rewrite rule.

    – Lex Li
    Mar 23 at 0:31











  • @LexLi thank you but I solved the problem without altering the SSL certificate (see answer below).

    – CB_Ron
    Mar 24 at 22:17

















0















I have two domains, one is shortened and is used when sending text messages with a query string because the regular domain is too long. Currently, a web page on a different IP address redirects the short domain to the long one, either to a particular page if it has the correct query string, or to the home page if it does not. I'm moving to Azure where I will have only one IP address. So I figured IIS URL Rewrite would be able to handle this task. Long domain is a HTTPS only site, and there is a HTTPS rule for it. Short domain is not; the links are always HTTP only. I've setup URL Rewrite to do the Redirects before the HTTPS rule and stopProcessing="true" is set for both rules. But when I visit http://mytxt.net, I get a browser warning that the SSL cert is invalid.



The server is Windows Server 2016 IIS 10. I've searched Google and Stack Oveflow specifically but haven't found anything matching my issue. Below is the code.



 <rule name="Txt QS Redirect" stopProcessing="true">
<match url="^(www.)?mytxt.net"/>
<conditions>
<add input="QUERY_STRING" pattern="^MyQS"/>
</conditions>
<action type="Redirect" url="https://www.myfullsite.net/respond.aspx" appendQueryString="true" redirectType="Temporary"/>
</rule>
<rule name="Txt No QS Redirect" stopProcessing="true">
<match url="^(www.)?mytxt.net"/>
<conditions trackAllCaptures="false">
<add input="QUERY_STRING" pattern="^MyQS" negate="true"/>
</conditions>
<action type="Redirect" url="https://www.myfullsite.net/" redirectType="Permanent"/>
</rule>
<rule name="HTTPS Redirect">
<match url="(.*)"/>
<conditions>
<add input="HTTPS" pattern="^OFF$"/>
</conditions>
<action type="Redirect" url="https://HTTP_HOST/R:1" redirectType="Permanent"/>
</rule>


Shouldn't the redirect happen first, and then the protocol change to HTTPS? Or are the browsers checking for SSL first, and when IIS says it is enabled, doing the protocol change on the client?










share|improve this question






















  • Your certificate must work with both domains or you have two SNI bindings for each of them. In short, https must work for both sites, before you create the rewrite rule.

    – Lex Li
    Mar 23 at 0:31











  • @LexLi thank you but I solved the problem without altering the SSL certificate (see answer below).

    – CB_Ron
    Mar 24 at 22:17













0












0








0








I have two domains, one is shortened and is used when sending text messages with a query string because the regular domain is too long. Currently, a web page on a different IP address redirects the short domain to the long one, either to a particular page if it has the correct query string, or to the home page if it does not. I'm moving to Azure where I will have only one IP address. So I figured IIS URL Rewrite would be able to handle this task. Long domain is a HTTPS only site, and there is a HTTPS rule for it. Short domain is not; the links are always HTTP only. I've setup URL Rewrite to do the Redirects before the HTTPS rule and stopProcessing="true" is set for both rules. But when I visit http://mytxt.net, I get a browser warning that the SSL cert is invalid.



The server is Windows Server 2016 IIS 10. I've searched Google and Stack Oveflow specifically but haven't found anything matching my issue. Below is the code.



 <rule name="Txt QS Redirect" stopProcessing="true">
<match url="^(www.)?mytxt.net"/>
<conditions>
<add input="QUERY_STRING" pattern="^MyQS"/>
</conditions>
<action type="Redirect" url="https://www.myfullsite.net/respond.aspx" appendQueryString="true" redirectType="Temporary"/>
</rule>
<rule name="Txt No QS Redirect" stopProcessing="true">
<match url="^(www.)?mytxt.net"/>
<conditions trackAllCaptures="false">
<add input="QUERY_STRING" pattern="^MyQS" negate="true"/>
</conditions>
<action type="Redirect" url="https://www.myfullsite.net/" redirectType="Permanent"/>
</rule>
<rule name="HTTPS Redirect">
<match url="(.*)"/>
<conditions>
<add input="HTTPS" pattern="^OFF$"/>
</conditions>
<action type="Redirect" url="https://HTTP_HOST/R:1" redirectType="Permanent"/>
</rule>


Shouldn't the redirect happen first, and then the protocol change to HTTPS? Or are the browsers checking for SSL first, and when IIS says it is enabled, doing the protocol change on the client?










share|improve this question














I have two domains, one is shortened and is used when sending text messages with a query string because the regular domain is too long. Currently, a web page on a different IP address redirects the short domain to the long one, either to a particular page if it has the correct query string, or to the home page if it does not. I'm moving to Azure where I will have only one IP address. So I figured IIS URL Rewrite would be able to handle this task. Long domain is a HTTPS only site, and there is a HTTPS rule for it. Short domain is not; the links are always HTTP only. I've setup URL Rewrite to do the Redirects before the HTTPS rule and stopProcessing="true" is set for both rules. But when I visit http://mytxt.net, I get a browser warning that the SSL cert is invalid.



The server is Windows Server 2016 IIS 10. I've searched Google and Stack Oveflow specifically but haven't found anything matching my issue. Below is the code.



 <rule name="Txt QS Redirect" stopProcessing="true">
<match url="^(www.)?mytxt.net"/>
<conditions>
<add input="QUERY_STRING" pattern="^MyQS"/>
</conditions>
<action type="Redirect" url="https://www.myfullsite.net/respond.aspx" appendQueryString="true" redirectType="Temporary"/>
</rule>
<rule name="Txt No QS Redirect" stopProcessing="true">
<match url="^(www.)?mytxt.net"/>
<conditions trackAllCaptures="false">
<add input="QUERY_STRING" pattern="^MyQS" negate="true"/>
</conditions>
<action type="Redirect" url="https://www.myfullsite.net/" redirectType="Permanent"/>
</rule>
<rule name="HTTPS Redirect">
<match url="(.*)"/>
<conditions>
<add input="HTTPS" pattern="^OFF$"/>
</conditions>
<action type="Redirect" url="https://HTTP_HOST/R:1" redirectType="Permanent"/>
</rule>


Shouldn't the redirect happen first, and then the protocol change to HTTPS? Or are the browsers checking for SSL first, and when IIS says it is enabled, doing the protocol change on the client?







iis https url-rewriting cross-domain






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 22 at 22:58









CB_RonCB_Ron

737




737












  • Your certificate must work with both domains or you have two SNI bindings for each of them. In short, https must work for both sites, before you create the rewrite rule.

    – Lex Li
    Mar 23 at 0:31











  • @LexLi thank you but I solved the problem without altering the SSL certificate (see answer below).

    – CB_Ron
    Mar 24 at 22:17

















  • Your certificate must work with both domains or you have two SNI bindings for each of them. In short, https must work for both sites, before you create the rewrite rule.

    – Lex Li
    Mar 23 at 0:31











  • @LexLi thank you but I solved the problem without altering the SSL certificate (see answer below).

    – CB_Ron
    Mar 24 at 22:17
















Your certificate must work with both domains or you have two SNI bindings for each of them. In short, https must work for both sites, before you create the rewrite rule.

– Lex Li
Mar 23 at 0:31





Your certificate must work with both domains or you have two SNI bindings for each of them. In short, https must work for both sites, before you create the rewrite rule.

– Lex Li
Mar 23 at 0:31













@LexLi thank you but I solved the problem without altering the SSL certificate (see answer below).

– CB_Ron
Mar 24 at 22:17





@LexLi thank you but I solved the problem without altering the SSL certificate (see answer below).

– CB_Ron
Mar 24 at 22:17












1 Answer
1






active

oldest

votes


















0














I solved my problem. It was the match url= regex that was the problem. Perhaps some IIS URL Rewrite guru can tell us why, because I still don't understand it. I used Failed Request Tracing to discover that it was not matching. This method is invaluable for troubleshooting URL Rewrite problems! I changed it to match url=".*" and moved the original regex to a condition. Here is the working code.



<rule name="Txt QS Redirect" stopProcessing="true">
<match url=".*"/>
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="HTTP_HOST" pattern="^(www.)?mytxt.net"/>
<add input="QUERY_STRING" pattern="^MyQS"/>
</conditions>
<action type="Redirect" url="https://www.myfullsite.net/respond.aspx" appendQueryString="true" redirectType="Temporary"/>
</rule>
<rule name="Txt No QS Redirect" stopProcessing="true">
<match url=".*"/>
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="HTTP_HOST" pattern="^(www.)?mytxt.net"/>
<add input="QUERY_STRING" pattern="^MyQS" negate="true"/>
</conditions>
<action type="Redirect" url="https://www.myfullsite.net/" redirectType="Permanent"/>
</rule>


URLs, with or without www., that start with the proper query string get redirected to the page that handles those requests; without the proper query string they are redirected to the site's home page.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55308824%2fhow-do-i-fix-https-warning-when-redirecting-one-domain-to-another-domain-using-i%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I solved my problem. It was the match url= regex that was the problem. Perhaps some IIS URL Rewrite guru can tell us why, because I still don't understand it. I used Failed Request Tracing to discover that it was not matching. This method is invaluable for troubleshooting URL Rewrite problems! I changed it to match url=".*" and moved the original regex to a condition. Here is the working code.



    <rule name="Txt QS Redirect" stopProcessing="true">
    <match url=".*"/>
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
    <add input="HTTP_HOST" pattern="^(www.)?mytxt.net"/>
    <add input="QUERY_STRING" pattern="^MyQS"/>
    </conditions>
    <action type="Redirect" url="https://www.myfullsite.net/respond.aspx" appendQueryString="true" redirectType="Temporary"/>
    </rule>
    <rule name="Txt No QS Redirect" stopProcessing="true">
    <match url=".*"/>
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
    <add input="HTTP_HOST" pattern="^(www.)?mytxt.net"/>
    <add input="QUERY_STRING" pattern="^MyQS" negate="true"/>
    </conditions>
    <action type="Redirect" url="https://www.myfullsite.net/" redirectType="Permanent"/>
    </rule>


    URLs, with or without www., that start with the proper query string get redirected to the page that handles those requests; without the proper query string they are redirected to the site's home page.






    share|improve this answer



























      0














      I solved my problem. It was the match url= regex that was the problem. Perhaps some IIS URL Rewrite guru can tell us why, because I still don't understand it. I used Failed Request Tracing to discover that it was not matching. This method is invaluable for troubleshooting URL Rewrite problems! I changed it to match url=".*" and moved the original regex to a condition. Here is the working code.



      <rule name="Txt QS Redirect" stopProcessing="true">
      <match url=".*"/>
      <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
      <add input="HTTP_HOST" pattern="^(www.)?mytxt.net"/>
      <add input="QUERY_STRING" pattern="^MyQS"/>
      </conditions>
      <action type="Redirect" url="https://www.myfullsite.net/respond.aspx" appendQueryString="true" redirectType="Temporary"/>
      </rule>
      <rule name="Txt No QS Redirect" stopProcessing="true">
      <match url=".*"/>
      <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
      <add input="HTTP_HOST" pattern="^(www.)?mytxt.net"/>
      <add input="QUERY_STRING" pattern="^MyQS" negate="true"/>
      </conditions>
      <action type="Redirect" url="https://www.myfullsite.net/" redirectType="Permanent"/>
      </rule>


      URLs, with or without www., that start with the proper query string get redirected to the page that handles those requests; without the proper query string they are redirected to the site's home page.






      share|improve this answer

























        0












        0








        0







        I solved my problem. It was the match url= regex that was the problem. Perhaps some IIS URL Rewrite guru can tell us why, because I still don't understand it. I used Failed Request Tracing to discover that it was not matching. This method is invaluable for troubleshooting URL Rewrite problems! I changed it to match url=".*" and moved the original regex to a condition. Here is the working code.



        <rule name="Txt QS Redirect" stopProcessing="true">
        <match url=".*"/>
        <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="HTTP_HOST" pattern="^(www.)?mytxt.net"/>
        <add input="QUERY_STRING" pattern="^MyQS"/>
        </conditions>
        <action type="Redirect" url="https://www.myfullsite.net/respond.aspx" appendQueryString="true" redirectType="Temporary"/>
        </rule>
        <rule name="Txt No QS Redirect" stopProcessing="true">
        <match url=".*"/>
        <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="HTTP_HOST" pattern="^(www.)?mytxt.net"/>
        <add input="QUERY_STRING" pattern="^MyQS" negate="true"/>
        </conditions>
        <action type="Redirect" url="https://www.myfullsite.net/" redirectType="Permanent"/>
        </rule>


        URLs, with or without www., that start with the proper query string get redirected to the page that handles those requests; without the proper query string they are redirected to the site's home page.






        share|improve this answer













        I solved my problem. It was the match url= regex that was the problem. Perhaps some IIS URL Rewrite guru can tell us why, because I still don't understand it. I used Failed Request Tracing to discover that it was not matching. This method is invaluable for troubleshooting URL Rewrite problems! I changed it to match url=".*" and moved the original regex to a condition. Here is the working code.



        <rule name="Txt QS Redirect" stopProcessing="true">
        <match url=".*"/>
        <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="HTTP_HOST" pattern="^(www.)?mytxt.net"/>
        <add input="QUERY_STRING" pattern="^MyQS"/>
        </conditions>
        <action type="Redirect" url="https://www.myfullsite.net/respond.aspx" appendQueryString="true" redirectType="Temporary"/>
        </rule>
        <rule name="Txt No QS Redirect" stopProcessing="true">
        <match url=".*"/>
        <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="HTTP_HOST" pattern="^(www.)?mytxt.net"/>
        <add input="QUERY_STRING" pattern="^MyQS" negate="true"/>
        </conditions>
        <action type="Redirect" url="https://www.myfullsite.net/" redirectType="Permanent"/>
        </rule>


        URLs, with or without www., that start with the proper query string get redirected to the page that handles those requests; without the proper query string they are redirected to the site's home page.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 24 at 22:16









        CB_RonCB_Ron

        737




        737





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55308824%2fhow-do-i-fix-https-warning-when-redirecting-one-domain-to-another-domain-using-i%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현