Quantcast
Channel: URL Rewrite Module
Viewing all articles
Browse latest Browse all 2482

URL Rewrite all Sub Directories to HTTPS

$
0
0

Hello,

I've been searching for an answer, but for some reason can't find exactly what I need.  I have URL Rewrite setup (IIS 8.5 Server 2012 R2) and it rewrites my root domain just fine from http to https.  The problem I have is when I pass a sub directory.  If I pass http://domain.com/rdweb I get redirected tohttps://domain.com.  What I want is for it to function intelligently so that if some accesshttp://domain.com/somesubdir that it gets sent tohttps://domain.com/somesubdir.  I'd love for this to be dynamic without the need for multiple rules.  Here's the current iteration of my web.config, any help would be much appreciated!  Thank you!

<rewrite><rules><rule name="HTTP/S to HTTPS Redirect" enabled="true" stopProcessing="true"><match url="(.*)" /><conditions logicalGrouping="MatchAny"><add input="{SERVER_PORT_SECURE}" pattern="^0$" /></conditions><action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="false" redirectType="Permanent" /></rule></rules></rewrite>


Viewing all articles
Browse latest Browse all 2482

Trending Articles