MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

SSL Enforce (Zatvorena) (Mono Support )

17198 put(a) pogledan, 3 odgovor(a) 17.7.2012. 11:33:15Kreirao(la) developer
developer

developer

17.7.2012. 11:33:15
Hello boys,

I need to enforce HTTPS when user write only HTTP in browser. How can i make this? I tried to add <if> into <UrlRewriter>, but don't work.

And when I add this code into <system.webserver> section, I got "Internal server Error":

<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
</rule>

Thanks.
Ovaj sadržaj još nije ocijenjen. 
165 Reputacija 19 Ukupno objava
khorvat

khorvat

17.7.2012. 13:51:56
Hi,

if you are using IIS then you can use the following routine to manage this.

Let me know if this suites your needs.

Regards
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava
developer

developer

18.7.2012. 11:08:02
Yes, it works.

Before I tried to use this,

<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
</rule>

but it doesn't work, because the Microsoft URL Rewrite module was not installed on my server. Now it's OK.
Ovaj sadržaj još nije ocijenjen. 
165 Reputacija 19 Ukupno objava