Small problem I ran into trying to create rewrite rules to meet following requirements:
All incomming request should consist of "https://", "www" and should have no trailing slashes. I've tried a few possible solutions, but not one could meet up to all three requirements. Could anyone help me out here? What I have so far is:
All incomming request should consist of "https://", "www" and should have no trailing slashes. I've tried a few possible solutions, but not one could meet up to all three requirements. Could anyone help me out here? What I have so far is:
According to you description, I have some confused.
Do you mean you want the rule start with https:// www or it could be anywhere in the url?
In my opinion, we will force the url start with the "https://www" and make sure there are no trailing slashes.
If this is your requirement, I suggest you could consider using below regex:
^https://www[^/].*$
If this doesn't match your requirement, please provide some example about which url will pass and which url will fail.
Best Regards,
Brando
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Participant
1563 Points
356 Posts
Using web.config to force https + www without trailing slash.
Jan 24, 2018 06:07 PM|johnyM456|LINK
Small problem I ran into trying to create rewrite rules to meet following requirements:
All incomming request should consist of "https://", "www" and should have no trailing slashes. I've tried a few possible solutions, but not one could meet up to all three requirements. Could anyone help me out here? What I have so far is:
But that doesn't seem to work for me...
Star
9831 Points
3120 Posts
Re: Using web.config to force https + www without trailing slash.
Jan 25, 2018 04:34 AM|Brando ZWZ|LINK
Hi johnyM456,
According to you description, I have some confused.
Do you mean you want the rule start with https:// www or it could be anywhere in the url?
In my opinion, we will force the url start with the "https://www" and make sure there are no trailing slashes.
If this is your requirement, I suggest you could consider using below regex:
If this doesn't match your requirement, please provide some example about which url will pass and which url will fail.
Best Regards,
Brando