OpsanBlog

Michael Coates - Microsoft Pragmatic Evangelist

My Latest Tweet
    Follow my Tweets

    Posted with:
     Windows Live Writer
     Download Live Writer

    My Windows Live Local Collections:
     Las Vegas
     Los Angeles
     San Jose
     Seattle
     Washington, DC
     My Walks

    Article Categories

    Archives

    Post Categories

    Bloggers

    IIS: Redirect from http to https

    I had the need to move access to a site from http to https to accommodate a customer requirement.  We had already published the http URL, and wanted to minimize the effect on the customer by redirecting requests to the SSL port.

    Once SSL is required to access a web site, accessing the site via port 80 generates a useful error that advises the user to use https instead of http when accessing the site.  Confirm you have access to the site over SSL by navigating to it using the https protocol.

    To redirect from port 80 to 443, we must create an ASP file that redirects to the same URL over SSL upon the 403.4 (SSL required) error.  The redirection file queries the request for Port 80 and reconstructs the URL for access via https.  We must also create a virtual directory that points to the original application directory to support redirection.

    For the purposes of this example:

    • The original (and newly secure) directory is called 'AppDirectory'.
    • The redirection file is called 'AppDirectory_Redirect.asp'.
    • The redirection support directory is called 'AppDirectory_Redirect'.

    First, create the redirection file and save it to 'AppDirectory' as 'AppDirectory_Redirect.asp'. Here is the code:

         If Request.ServerVariables("SERVER_PORT")=80 Then
             Dim strQUERY_STRING
             Dim strSecureURL
             Dim strWork

             ' Get server variables
             strQUERY_STRING = Request.ServerVariables("QUERY_STRING")

             ' Fix the query string:
             strWork = Replace(strQUERY_STRING,"http","https")
             strWork = Replace(strWork,"403;","")

             ' Now, set the new, secure URL:
             strSecureURL = strWork
    'response.write(strSecureURL) ' uncomment for sanity check.
             Response.Redirect strSecureURL
         End If

    <%
         If Request.ServerVariables("SERVER_PORT")=80 Then
             Dim strSecureURL
             strSecureURL = "https://"
             strSecureURL = strSecureURL & Request.ServerVariables("SERVER_NAME")
             strSecureURL = strSecureURL & "/{NameOfSecureDirectory}"
             Response.Redirect strSecureURL
         End If
    %>

    In this example, do not change “SERVER_PORT” or “SERVER_NAME” as they're the hard-coded names of the server variables. 

    In IIS, use the virtual directory creation wizard to create the redirect virtual directory 'AppDirectory_Redirect', pointing to 'AppDirectory' as the physical path.  Leave the access permissions as Read.

    In IIS, right click the original application directory 'AppDirectory' and click properties.  Follow these steps:

    1. Click the 'Custom Errors' tab and double-click 403.4.
    2. In the 'Message Type' box, click URL.
    3. In the URL box, type '/AppDirectory_Redirect/AppDirectory_Redirect.asp' (redirecting to the redirect file you created earlier).
    4. Click the 'Directory Security' tab.
    5. Under secure Communications, click 'Edit'.
    6. Select 'Require secure channel (SSL).  Set 128-bit encryption as appropriate for your certificate.
    7. Click 'OK' until your changes are saved.
    8. Restart IIS Admin.

    Note: you can always restore the original 403.4 error message by clicking 'Set to Default'

    Test the site by navigating to 'http://AppDirectory'; you should be redirected to the site over https.

     

    posted on Sunday, April 17, 2005 6:10 PM

    Feedback

    # re: IIS: Redirect from http to https 6/17/2005 11:48 AM John

    I have set up ssl on my 2003 iis 6. o site. I needed to redirect port 80 to port 443. Your script sure looks like it will work however it does not. In trouble shooting it seems that the script isnt running, although if I set the custom errors 403.4 tab to file instead of url and point it to the same place, it will display the text of the script. That tells me it is in the right place. However running as a url the error "Secure Channel Required
    This Virtual Directory requires a browser that supports the configured encryption options." persists. This is a sharepoint site running under IIS, I wonder if the "Appdirectory" as you call it (which for me if I look under the website properties/homedirectory tab it reads c:\inetpub\wwwroot) is really where the site exsists. Any help would be appreciated.

    # re: IIS: Redirect from http to https 6/17/2005 12:02 PM Michael Coates

    I had updated the script once I discovered some issues (not yours) in production. The latest version is posted in the body of the post; you may have to refresh to get it.

    If SharePoint is involved, you likely have to go in to the SP Administration tool and exclude the the virtual directory you're trying to redirect.

    HTH
    mc

    # re: IIS: Redirect from http to https 7/21/2005 4:46 AM Bill Cressman

    John - I had the same problem. In the Custom Error Messages dialog for 403.4, you need to have the Message Type property set to "URL" instead of "File".

    By the way, I have a slightly simpler (at least in my mind) ASP program that you can use as your redirector script:

    <%
    dim strNewURL, strOldURL
    if request.ServerVariables("https")<>"on" then
    strNewURL = "https://" & Request.ServerVariables("SERVER_NAME") _
    & Request.ServerVariables("URL") & "?" _
    & Request.ServerVariables("QUERY_STRING")
    response.redirect(strNewURL)
    else
    response.write("Already HTTPS...")
    end if
    %>

    # re: IIS: Redirect from http to https 10/19/2005 5:10 PM Rob

    your sKript doesnt work, please remove junk...the internet is running out of space !

    # re: IIS: Redirect from http to https 10/31/2005 12:04 PM Art

    Rob, please explain your comment. It makes you sound like an AOL user.

    It seems, unfortunately, that the internet is not running out of morons.

    # re: IIS: Redirect from http to https 11/1/2005 7:42 AM opsan

    I did update the script in the body of the post to work with IIS60; if using IIS50, you need to comment out the line with '403' in it.

    If someone wants to post a version that detects IIS version, please feel free. I guess you could use a simple if-then-else clause; if I get time, I'll tinker with it.

    # re: IIS: Redirect from http to https 11/10/2005 1:25 PM tostinni

    Hi,
    Thanks for your tutorial, in fact I had made something identicall before finding your page, but yours is better explained ;)

    Just a little remark, I'm using IIS6 (Win2003) and I needed to delete also the port. In fact QUERY_STRING display "403;http://mydomain.com:80"
    So if I just made a replace as you did, there's an error.

    # re: IIS: Redirect from http to https 11/30/2005 8:26 PM Hunter

    This is a greatly detailed tutorial. It helped me out a lot.

    # re: IIS: Redirect from http to https 12/2/2005 7:44 AM Tony

    About redirecting http to https.
    How do you write the script in an asp file.
    Do you have to state script language and all for it to work?

    # re: IIS: Redirect from http to https 12/8/2005 8:07 AM Sue

    I have replaced the 403.4 in IIS 6 with a .htm file that contains the following Javascript. It determines the http URL that the user went to and then redirects them to the https version.

    <Script language="JavaScript">
    <!-- begin hide

    function goElseWhere()
    {

    var oldURL = window.location.hostname + window.location.pathname;


    var newURL = "https://" + oldURL;


    window.location = newURL;

    }
    goElseWhere();

    // end hide -->
    </script>

    # re: IIS: Redirect from http to https 12/16/2005 2:35 AM James

    I didn't manage to the the redirection files working. Seems that, for me at least, it reaches the SSL before running the script so it doesn't do anything.

    Never thought I'd say this - thanks for the JavaScript solution!

    # re: IIS: Redirect from http to https 1/5/2006 6:15 AM Bobby

    Sue,
    Your javascript .htm file works for me. Thanks so much!

    # re: IIS: Redirect from http to https 1/5/2006 1:11 PM Junaid

    JavaScript solution is easy weasy and Works

    # re: IIS: Redirect from http to https 1/30/2006 11:26 AM Joe

    JavaScript solution worked for me. Thanks Michael & Sue!

    # re: IIS: Redirect from http to https 1/30/2006 11:46 AM Joe

    I spoke too soon ... Sue's JS almost works. Here's an improved version:

    <Script language="JavaScript">
    <!-- begin hide

    function goElseWhere()
    {

    var oldURL = window.location.hostname + window.location.pathname;


    var newURL = "https://" + oldURL;

    query = '' + window.location;
    position = query.indexOf('?');
    if (position > -1)
    {
    query = query.substring(position + 1);
    newURL = newURL + "?" + query;
    }


    window.location = newURL;

    }
    goElseWhere();

    // end hide -->
    </script>

    # re: IIS: Redirect from http to https 1/30/2006 2:19 PM Ben

    Great, thanks! That javascript seems pretty slick. Minor issue that if they have javascript turned off, it breaks. But so much breaks on so many sites that it shouldn't be a big deal.

    # re: IIS: Redirect from http to https 2/1/2006 12:46 PM Paul

    The above works for Firefox but not Explorer... Any thoughts?

    I get the following error:

    HTTP Error 403 - Forbidden
    Internet Explorer

    # re: IIS: Redirect from http to https 2/1/2006 1:58 PM opsan

    I haven't tested the JavaScript: my fix is on the IIS side (see the top of this post for script samples).

    Any JS experts can speak up?

    # re: IIS: Redirect from http to https 2/24/2006 1:17 PM Sara

    I used the JavaScript solution and it worked for me. Thanks!

    # re: IIS: Redirect from http to https 3/3/2006 7:01 AM Tom

    Re: Paul 2-1-2006
    I'm getting the same error on "SOME" IE's. On most browsers I've tried (including IE), an attempt to access URL www.mydomain.com redirects the user to https://www.mydomain.com (***GOOD***). HOWEVER!, I've been notified by some users of IE 6.0 that an attempt at www.mydomain.com yields an

    HTTP Error 403 - Forbidden
    Internet Explorer
    ***So obviously their browser is not generating a 403.4 error which is the reason for no redirect. Why not?

    Is this just because of personal settings in IE?

    # re: IIS: Redirect from http to https 3/6/2006 9:13 PM Casey

    I'd put money on it having to do with if the users browser has 'show friendly http error messages' enabled.

    # re: IIS: Redirect from http to https 3/7/2006 2:16 AM Amit

    Would anybody know how to avoid the SSL redirection message when moving from Non-SSL to SSL page?

    # re: IIS: Redirect from http to https 4/28/2006 8:24 AM Adam

    Does anyone know how to have the whole site redirect to HTTPS? I can only get it working for a sub directory

    # re: IIS: Redirect from http to https 5/26/2006 12:23 AM Dagar

    A VERY SIMPLE method for this tedious work.
    Create one HTML page[say Redirectssl.htm] with Folowing Javascript code :
    <SCRIPT type=text/javascript>
    <!--
    if (location.protocol != 'https:')
    {
    window.location = 'https://'+ location.host + location.pathname + location.search;
    //alert(location.host + location.pathname + location.search); Just for sanity check

    }
    // -->
    </SCRIPT>
    Just Save this page in root directory of WebSite & Follow the steps :
    1)Replac the 403.4[Message type be FILE] in IIS 6 with a Redirectssl.htm file that contains the above Javascript.
    2)Save changes & Restart IIS admin[not mandatory] & its done with only 1 line of script.

    My solution is basically same as above but its very small , a ONE LINER :).
    This will redirect the whole site at once & is useful in scenario where a site has two IP's [within organisation & outside organisation ] to access.
    Hope it proves useful to somebody.
    Happy Programming ............ :)

    # re: IIS: Redirect from http to https 5/31/2006 10:54 PM Tinman

    The final solution works a treat 1 minute to setup and configure and hey presto ...

    Ta very much

    # re: IIS: Redirect from http to https 6/9/2006 6:06 AM Justin

    I Used the JS and changed it to use a port of 4433
    Here is the example:
    <Script language="JavaScript">
    <!-- begin hide

    function goElseWhere()
    {

    var oldURL = window.location.hostname + ":4433" + window.location.pathname;


    var newURL = "https://" + oldURL;

    query = '' + window.location;
    position = query.indexOf('?');
    if (position > -1)
    {
    query = query.substring(position + 1);
    newURL = newURL + "?" + query;
    }


    window.location = newURL;

    }
    goElseWhere();

    // end hide -->
    </script>

    # re: IIS: Redirect from http to https 6/15/2006 1:32 PM jim

    okay...after days of pain... DAGAR wins my vote..holy cow, how easy can it get!
    allow me to buy you a beer!

    # re: IIS: Redirect from http to https 7/6/2006 9:21 PM Matt

    In case you are still getting the "Secure Channel Required This Virtual Directory requires a browser that supports the configured encryption options" message you may need to ensure the properties of the asp file you are using are set so that it itself doesn't require ssl. To do this, from within IIS admin, double click the .asp file and go to the File Security tab, then click the bottom edit and uncheck the "require a secure channel" box. That should do it and allow you to use .asp instead of java.

    # re: IIS: Redirect from http to https 7/24/2006 3:19 PM pete

    hi everybody. I'm missing something here - The solutions are looking great, but why using an asp or javascript for redirection, if the redirect to url function in IIS cando that. Is the reason to have a more flexible function, that can handle multiple different queries? If yes, which scenaries would require this?


    # re: IIS: Redirect from http to https 8/1/2006 11:30 PM Krishna

    This is a nice detailed tutorial. It really helped me out a lot.

    # re: IIS: Redirect from http to https 8/10/2006 11:06 AM Fay

    I am new to this - is it possible to redirect all http requests to http. I have this application that has hardcoded http links inside and I am trying to get it to work over https. The solution above assumes that the URL is on the wondow??

    thanks
    Fay

    # re: IIS: Redirect from http to https 9/1/2006 12:07 AM Seetha

    Dagar,

    Cheers man!.. You win my vote too :-))

    Regrads,
    Seetha

    # re: IIS: Redirect from http to https 9/1/2006 9:14 AM Joe

    Dagar, you rock, sir. Thanks!

    # re: IIS: Redirect from http to https 9/15/2006 5:11 AM Darren

    Dagar,

    Thanks, that works great. I now have 6 websites with your redirect.

    Darren

    # re: IIS: Redirect from http to https 10/6/2006 4:28 AM lbr

    1) if client doesn't have JS ?
    2) IIS 6.0 .asp redirect works perfectly for me
    just change custom error 403/4 message type
    to Url and write path to .aspx


    redirect.aspx:

    <%
    If Request.ServerVariables("SERVER_PORT") = 80 Then
    Try
    Dim strQUERY_STRING
    Dim strSecureURL
    Dim strWork

    ' Get server variables
    ' strQUERY_STRING = Request.Url.AbsoluteUri.ToString()
    strQUERY_STRING = Request.ServerVariables("QUERY_STRING")
    'Response.Write(strQUERY_STRING)

    ' Fix the query string:
    strWork = Replace(strQUERY_STRING, "http", "https")
    strWork = Replace(strWork, "403;", "")
    strWork = Replace(strWork, "80", "")

    ' Now, set the new, secure URL:
    strSecureURL = strWork
    'Response.Write(strSecureURL) ' uncomment for sanity check.
    Response.Redirect(strSecureURL)
    Catch ex As Exception
    End Try
    End If
    %>

    # re: IIS: Redirect from http to https 11/7/2006 6:21 AM Jonas

    JavaScript-solution is very slick! Works like a charm! Thanks!

    When using just an .htm-file there is much trouble going out the window =)

    # re: IIS: Redirect from http to https 12/28/2006 11:23 AM juanjava

    an alternative way to do this is to set up another virtual web site that has 443 enabled and port 80 disabled. Then, delete all content from the original port 80 site and just have a default page and set it to redirect to the 443 url - no scripting required.

    # re: IIS: Redirect from http to https 1/4/2007 11:23 AM Ben Higgins

    Make sure that when you redirect your 403.4 script that you do the following:

    1) Make sure that you are redirecting to URL and not file - otherwise the script won't be processed by the server.

    2) Make sure that you make the script specifically as NOT "Require Secure Channel". I found this was a HUGE problem when implimenting this on my production server.

    # re: IIS: Redirect from http to https 2/1/2007 1:05 PM Jon

    This JS works great, however now i cannot login to my sharepoint site. All the credentials are giving me Error: Access deined under Sharepoint. Any ideas?

    Thanks in advance

    # re: IIS: Redirect from http to https 2/12/2007 3:10 AM Aqeloutro

    About that Access Denied under Sharepoing you probably must allow anonymous access for the redirecting page. At least it worked for me.

    # re: IIS: Redirect from http to https 3/13/2007 10:13 AM Dayve

    Ben,

    This is the part that made a huge difference in how the redirection works:

    "2) Make sure that you make the script specifically as NOT "Require Secure Channel". I found this was a HUGE problem when implimenting this on my production server. "

    Thank you.

    Dayve

    # re: IIS: Redirect from http to https 4/23/2007 12:07 PM Mark

    I'm running into the same problem a couple of the other contributors here have experienced. I have friendly errors turned off and I'm getting a basic "403 - Forbidden" error message instead of 403.4. The 403 error is not exposed on the "Custom Errors" tab within IIS6. Looking at the page properties reveals that it is being generated by the shdoclc.dll component. Does anyone know a workaround for this?

    # re: IIS: Redirect from http to https 4/23/2007 1:50 PM Chris

    Okay, here is the common mistake I am seeing people make with this script.

    YOU MUST turn the SSL requirement OFF for the redirection file.

    If you do not you will end up with an error.

    Remove the SSL requirement on the redirect file and it will work in 5.0 and 6.0.

    # re: IIS: Redirect from http to https 5/9/2007 2:39 PM john

    I'm trying to set this up on a Sharepoint server, not using a virtual directory and can't get it to work. Instead I get directed to the SP root followed by "/_vti_bin/owssvr.dll".

    Any ideas would be much appreciated...

    # Trackbacking your entry... 6/1/2007 12:35 PM SearchGuild

    [quote:c3529a8a16=\"MrRex\"]welcome, dotnetninja!

    I have seen some https: sites in the Google SERPs, but that doesn\'t mean a whole lot. It just makes me think that if you give the spiders access to it, then they will crawl it. But I\'m not all that familiar with https.[/quote:c3529a8a16]

    Thanks for the welcome, and great forum here. I am certainly no https expert either. I have a site that needed https for HIPAA compliance, and I didn\'t want to fiddle around with creating two different sites, so I just https\'d the whole thing. I\'ve seen other sites do this, and the minor performance (encryption/decryption processes) seem to be negligable.

    Basically, I do a redirect from port 80 to port 443 (standard HTTPS port). There are lots of good examples on doing this. It makes use of the 403.4 message.

    IIS:
    - http://blog.opsan.com/archive/2005/04/17/395.aspx

    - http://weblogs.asp.net/pwilson/archive/2004/12/23/331455.aspx

    Apache:
    - http://www.karkomaonline.com/article.php/2005080614195334
    - http://www.afp548.com/article.php?story=20050608053907148

    Google seems ok with it, as do Yahoo and MSN.

    Best wishes!

    # re: IIS: Redirect from http to https 6/4/2007 9:23 AM Sri

    Check this out. A single line code for redirection from MS

    # hardcore 9/2/2007 11:20 PM hardcore

    {11

    # pussy 9/2/2007 11:23 PM pussy

    {11

    # female 9/3/2007 1:23 AM female

    {11

    # re: IIS: Redirect from http to https 9/11/2007 11:26 PM ASPNETMANIac

    Dagar...thank you for a sweet code. Works perfect!!!

    # re: IIS: Redirect from http to https 9/13/2007 11:29 AM Mike

    Thanks Dagar. I saved your code to an HTML. Then I went into my virtual directory properties. I opened the Custom Errors tab. And, I changed the 403;4 setting to point to my HTML File.

    I tried to use the ASP, but I could not get it to work. There seem to be steps missing in the instructions.

    # re: IIS: Redirect from http to https 9/14/2007 8:53 AM andy pandy

    I used the java script and it worked locally but oustide on the internet it didn't work. It just gave me a blank page.

    # re: IIS: Redirect from http to https 9/16/2007 6:26 PM Rao Konchada

    Sorry, it's IIS 6.0..thanks

    # re: IIS: Redirect from http to https 9/24/2007 1:19 PM kral oyun

    About that Access Denied under Sharepoing you probably must allow anonymous access for the redirecting page. At least it worked for me

    # re: IIS: Redirect from http to https 11/16/2007 12:31 AM joop

    since IE 6 generates its own crappy 403.4 page this is no solve. I can't just go telling everyone who uses my site to uncheck the "friendly error page" box in theyre settings.
    So usesless.

    # re: IIS: Redirect from http to https 11/28/2007 9:19 AM NSG

    Kudos to Dagar,
    You were on the spot Pal..

    # re: IIS: Redirect from http to https 12/6/2007 7:07 AM Ray

    DAGAR - YOU ROCK!!!!

    # www.r10.net küresel ısınmaya hayır seo yarısması 12/8/2007 3:46 AM www.r10.net küresel ısınmaya hayır seo yarışm

    thank you

    # re: IIS: Redirect from http to https 12/9/2007 1:23 AM Sonny

    If you are using the .asp you have to make sure that the properties for the virtual directory had the 'Require Secure Channel' unticked - otherwise it needs SSL enabled for the redirect which totally defeats the purpose!

    # re: IIS: Redirect from http to https 12/12/2007 1:58 PM learningbot

    thanks for sharing the code and explanation

    # re: IIS: Redirect from http to https 1/7/2008 4:26 AM rüya tabirleri

    Seems that, for me at least, it reaches the SSL before running the script so it doesn't do anything.

    # re: IIS: Redirect from http to https 1/9/2008 10:50 AM John Swidorski

    Have you ever had a problem with "unchecking" Require Secure Channel? I am running IIS 6.0 and it thinks that it is still checked after I uncheck it. I have also looked at the MS KB that tells you to uncheck the 128-Bit and then uncheck...

    # re: IIS: Redirect from http to https 1/10/2008 2:26 PM automotive repair manual

    If you are using the .asp you have to make sure that the properties for the virtual directory had the 'Require Secure Channel' unticked - otherwise it needs SSL enabled for the redirect which totally defeats the purpose!

    # re: IIS: Redirect from http to https 1/21/2008 3:44 AM vatan

    I didn't manage to the the redirection files working. what can i do?

    # re: IIS: Redirect from http to https 2/1/2008 2:50 AM Djoul6

    Verify the content of your custom redirecting page.
    Check that you have the "<!DOCTYPE HTML..." tag (like for all others iis errors pages.)

    I had the same problem (a custom 403-4 error page), but this one always throw a 403 Forbidden... After adding this tag, it works !

    # re: IIS: Redirect from http to https 2/4/2008 8:14 PM Ax

    Dagar Rules!
    Beautiful Script & It works beautifully too :)

    # re: IIS: Redirect from http to https 2/6/2008 5:03 PM ses kayıt

    what can i do?

    # re: IIS: Redirect from http to https 3/2/2008 10:47 AM etkirsch

    Tried about four different "solutions" and this was the easiest and the only one that worked without issues. Thanks very, very much!!

    # re: IIS: Redirect from http to https 3/14/2008 6:54 AM Youtube

    I didn't manage to the the redirection files working. what can i do?

    # re: IIS: Redirect from http to https 3/28/2008 1:49 PM robbierob

    Dagar's solution is BY FAR the easiest I've come across. Works wonderfully!

    # re: IIS: Redirect from http to https 3/31/2008 1:29 PM Rize

    If you are using the .asp you have to make sure that the properties for the virtual directory had the 'Require Secure Channel' unticked - otherwise it needs SSL enabled for the redirect which totally defeats the purpose!

    # re: IIS: Redirect from http to https 3/31/2008 1:29 PM Rize

    Check this out. A single line code for redirection from MS

    # re: IIS: Redirect from http to https 3/31/2008 8:51 PM Wong Seoul

    Can't you just do this by using IIS (under home directory tab) ?

    Thanks

    # re: IIS: Redirect from http to https 5/19/2008 10:10 PM Peter

    Dager man, you rock! Thanks so much!

    # re: IIS: Redirect from http to https 5/21/2008 7:54 PM max

    I have problem here, im using dagar redirect script and its working perfectly in IE but in firefox it will ask to download the script instead running the script.anybody know how to solve it!!

    # re: IIS: Redirect from http to https 6/10/2008 11:41 AM SD Logan

    There is a better way to do it using the file component of IIS. Instead of changing all those variable why not write a Java script and replace HTTP with HTTPS. Once completed, it would simply replace it using the ERROR403.htm. So write a script using error 403.htm and replace that file with the java script you write.

    # re: IIS: Redirect from http to https 6/18/2008 2:58 AM xy

    It really worked ! cheers :) thanks a lot Dager!

    # re: IIS: Redirect from http to https 6/20/2008 1:02 PM Karadeniz

    Check this out. A single line code for redirection from MS

    # re: IIS: Redirect from http to https 7/17/2008 2:29 PM Sarasota

    just change custom error 403/4 message type
    to Url and write path to .aspx

    redirect.aspx Both of them right... 403/404 ?

    # re: IIS: Redirect from http to https 7/24/2008 2:08 PM sesli

    thanks admin

    # re: IIS: Redirect from http to https 8/4/2008 11:22 AM forum

    thanks for your share.

    # re: IIS: Redirect from http to https 8/4/2008 11:22 AM sorgulama

    This is a nice detailed tutorial. It really helped me out a lot.

    # re: IIS: Redirect from http to https 8/17/2008 5:18 PM SESLİ27

    This is a nice detailed tutorial. It really helped me out a lot.

    # re: IIS: Redirect from http to https 8/17/2008 5:18 PM Radyo Temalari

    This is a nice detailed tutorial. It really helped me out a lot.

    # re: IIS: Redirect from http to https 8/27/2008 11:21 PM eglenclub

    tThis is a nice detailed tutorial

    # re: IIS: Redirect from http to https 8/28/2008 9:37 PM Janny

    javascript that's very nice code
    thank you

    # re: IIS: Redirect from http to https 9/9/2008 4:17 AM Şarkı Sözleri Lyrics

    very nice code me too.

    # re: IIS: Redirect from http to https 9/11/2008 9:33 PM noel

    raise the roof dagar. your the most. thanks....

    # re: IIS: Redirect from http to https 10/6/2008 3:08 PM Joshua

    Thanks for the Java script Sue... Worked great!

    # re: IIS: Redirect from http to https 10/10/2008 2:43 PM nedir kimdir

    I used the java script and it worked locally but oustide on the internet it didn't work. It just gave me a blank page.

    # re: IIS: Redirect from http to https 10/14/2008 4:58 PM haberburdur

    Java script good programmig language

    # re: IIS: Redirect from http to https 10/20/2008 9:35 AM Rohit

    does this method display padlock on the https page...the first page we redirect to i mean????

    # re: IIS: Redirect from http to https 10/27/2008 12:38 AM Videolar

    I couldnt make it work

    # re: IIS: Redirect from http to https 10/30/2008 8:18 AM Sunny

    All the above redirect scripts on IIS don't work if I try to access a jsp on backend WebSphere App Server through plugin.

    # re: IIS: Redirect from http to https 10/30/2008 8:19 AM Sunny

    IIS Experts, please comment

    # forums 11/11/2008 12:56 PM Dog forums

    The final solution works a treat 1 minute to setup and configure and hey presto ...

    # reviews 11/11/2008 12:57 PM Bodybuilding Store Reviews

    I am new to this - is it possible to redirect all http requests to http. I have this application that has hardcoded http links inside and I am trying to get it to work over https. The solution above assumes that the URL is on the wondow??

    # re: IIS: Redirect from http to https 11/11/2008 2:17 PM Arkadaş

    Good stuff thanks

    # re: IIS: Redirect from http to https 11/19/2008 12:04 PM Tux

    The original ASP worked for me. This kind of insanity is why I prefer to work on my Apache systems. The force to use SSL option should automatically redirect.

    # re: IIS: Redirect from http to https 12/3/2008 6:51 AM pilav

    Good stuff thanks brother

    # porno 12/5/2008 7:50 AM porno

    tahank

    # re: IIS: Redirect from http to https 12/14/2008 6:56 PM hq

    this one is good

    # re: IIS: Redirect from http to https 12/17/2008 10:21 AM chrisneglia

    why not this?

    <script type='text/javascript'>

    var newHref = window.location.href;
    newHref = newHref.replace(/http/, "https");
    window.location.href = newHref;

    </script>

    # re: IIS: Redirect from http to https 12/31/2008 11:30 AM girl games

    cool so great knowledges

    # Redirect to https | keyongtech 1/18/2009 9:35 AM Pingback/TrackBack

    Redirect to https | keyongtech

    # re: IIS: Redirect from http to https 1/23/2009 11:06 AM John Doe

    Javascript worked for me too! Thanks Sue!

    # re: IIS: Redirect from http to https 1/28/2009 7:57 AM umreally?

    You guys are crazy wanting javascript to be responsible for http to https redirects... the server should handle those requests, always. you never know what browser someone is using. don't setup your redirects to rely on the client having javascript enabled... *sigh* Server redirects (such as using ASP for IIS) are the only way to go...

    # re: IIS: Redirect from http to https 2/12/2009 9:36 AM asdf

    LOL Agree with Umreally......javascript handling https redirects isa dumb idea

    # re: IIS: Redirect from http to https 2/16/2009 9:28 AM Paul

    This issue is easily resolved by unchecking the 'require encryption' box on the 'redirected' folder security settings.

    The setting is propagated down to all folders as part of switching SSL on. Your error message folder needs to have that set to off.

    # re: IIS: Redirect from http to https 4/2/2009 5:37 AM SEO Milwaukee

    For anyone who's interested, I came across this post while researching ASP.Net redirection problems while using Mosso cloud site hosting. Because Mosso uses load balancing servers, the server that processses a page request is not the same as the one that initially handles it. By the time the request gets processed all the headers appear as if the request is not a secure request. Request.Url.AbsoluteUri will show a "http" instead of "https", Request.ServerVariables("https") will return "off", and Request.ServerVariables("SERVER_PORT") will show 80. If you need to rely on these in your code for switching between http and https, Mosso cloud sites are not compatible with this code.

    # re: IIS: Redirect from http to https 4/28/2009 2:44 PM barbie spiele

    thanks a lot for this article

    # re: IIS: Redirect from http to https 6/1/2009 1:15 PM Wes

    Newbie question,

    why is the code repeated? i.e. top half without <%..%> ?

    thanks.

    # re: IIS: Redirect from http to https 7/1/2009 5:41 AM Personal Blog

    Thank good article...

    # re: IIS: Redirect from http to https 7/3/2009 11:37 AM Resul

    Hey, nice post, very well written. You should write more about this.

    # re: IIS: Redirect from http to https 7/3/2009 11:38 AM Kocaeli

    Thank you very much for this information.

    Title  
    Name  
    Url
    Comments   

    The opinions expressed herein are my own and are not intended to represent those of my employer.