Link to home
Start Free TrialLog in
Avatar of Moey_G
Moey_GFlag for Australia

asked on

Redirect http to https link

Hi Everyone,

I have installed exchange 2003 server on Windows 2003 server and all is working fine. The only problem I am facing is when using owa 2003. I have installed a SSL certificate for this site and would like the user to be redirected when they type in http://owa.domain_name/exchange  to the secure owa 2003 link https://owa.domain _name/exchange. The problem is they have to enter the "s" instead , which most users will not remember to do.

Is there a way to redirect them imminently to the secure site from the link with http:// ?

Regards,

Moey_G
Avatar of spoz
spoz

A quick fix would be to insert the following code into the index page of the unsecured website:

<html>
<head>
</head>
<body>
<script language="javascript">
<!--
location.replace("https://owa.domain_name/exchange")
//-->
</script>
</body>
</html>
With this code in the index page you can send it to the secure server:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>OWA</TITLE>
<META content=en-us http-equiv=Content-Language>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<META content="Microsoft FrontPage 4.0" name=GENERATOR>
<META content=FrontPage.Editor.Document name=ProgId>
<meta http-equiv="refresh" content="5; url=https://owa.domain _name/exchange">
<meta name="keywords" content="automatic redirection">

</HEAD>

<BODY>

Sending to:  https://owa.domain _name/exchange
</BODY></HTML>


Regards
Jorge Curioca
jcurioca@net.com.mx
in iis manager
set the properties for the deault page to require secure communication
this forces https and redirects them i thought.
This works for me:


  <script>
  if (location.protocol=="http:") {location="https://"+location.host}
  </script>


This should be put withn the head tags..

Avatar of Moey_G

ASKER

Hi everyone,

thankyou for all your prompt replies. I have found a microsoft article that explains how to do this. Article number is 555126.
This all works well while you are logged internally to the network , but I want the same redirection to happen when a user types in their browser http://owa.domainname/exchange. Any ideas on this article or how to overcome this issue.
I do this all the time.  Here's the solution to get the redirect to work properly.

1. Go into the C:\inetpub\wwwroot directory and create a folder called "Owaasp"
2. Create a file called "owahttps.asp" and put it into the directory you created in #1 (owaasp)
3. Paste this code into the owahttps.asp file using notepad.  Do not modify this file in any way!

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

Save the file.

4. Now open the IIS Manager
 * Go to the properties of the Exchange Virtual Directory inside Internet Services Manager. There are several related to OWA, but just modify the one called "Exchange".  Go to the Custom Error Messages Tab.

Once on the Custom Errors tab, edit the properties of error 403.4.  The next step is very important.  Select "Message Type"  =    URL
And for URL, type in this =    /owaasp/owahttps.asp

Click Ok and exit.

5. If you have not already, go to the Directory Security Tab and select Edit under Certificates (from the Exchange Virtual Directory) and select to require SSL.  

6. Make sure port 443 is open on the firewall and restart all IIS services by typing this:

net stop iisadmin /y

Click on START, RUN, then type Services.msc.  Restart all the services that were stopped.

This will redirect client from http to https.  

Avatar of Moey_G

ASKER

dazer1virginia,

I have already applied the above information but it stil has problems connecting to owa when requesting link from external connections. This works totally fine internally, but if a staff member was to connect to his mail remotely, they still have to place the https: instead of http: .
Avatar of Moey_G

ASKER

this is the same article as the previous comment. It still does not explain why remote users are unable to connect to the exchange server using http: ?
ASKER CERTIFIED SOLUTION
Avatar of dazer1virginia
dazer1virginia

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This is what I on my websites:

<%
   thispage = request.servervariables("SERVER_NAME") & request.servervariables("URL"))
   q = request.servervariables("QUERY_STRING")
   if len(q)<>0 then thispage = thispage &"?"& q
   if ucase(request.serverVariables("HTTPS"))<>"ON" then response.redirect "https://"& thispage
%>