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;
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
add a comment |
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
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
add a comment |
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
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
iis https url-rewriting cross-domain
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered Mar 24 at 22:16
CB_RonCB_Ron
737
737
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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