简体   繁体   中英

Need a rule for IIS Rewrite for https

I have to add a rule for the following and can't get it to work. The website is available under https www.domain.com. The certificate only works for that. If I try with https domain.com I get an 404 error. How can I redirect from https domain.com to https www.domain.com?

Any ideas?

I already covered when someone uses http und will be redirected to https.

Sorry, I couldn't write the complete url because I have not enough reputation. So I cut out the ://

You Can try This

<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions><add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
</rule>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM