mcse2007
asked on
Assistance on script
Hi,
I have been asked by my client to redirect HTTP to HTTPS behind ISA (firewall).
So, I did some digging in the ISA forum and found the attached script to redirect HTTP to HTTPS. But, I would like to refine it.
For instance, if a clueless user typed the below, he gets redirect to
HTTPS://webmail.domain.com.au/owa (no matter how you tell the users to use HTTPS, they are so clueless that they keep typing HTTP).,
Redirect http://webmail.* ===> https://webmail.domain.com.au/owa
Appreciate if you can assist to modify the attached script?
redirect.txt
I have been asked by my client to redirect HTTP to HTTPS behind ISA (firewall).
So, I did some digging in the ISA forum and found the attached script to redirect HTTP to HTTPS. But, I would like to refine it.
For instance, if a clueless user typed the below, he gets redirect to
HTTPS://webmail.domain.com.au/owa (no matter how you tell the users to use HTTPS, they are so clueless that they keep typing HTTP).,
Redirect http://webmail.* ===> https://webmail.domain.com.au/owa
Appreciate if you can assist to modify the attached script?
redirect.txt
ASKER
FYI - We are using Exchange 2007 with ISA 2004 SP3. None of the above link applicable to this issue.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks, but where do I insert that command into the existing script?
...as soon as you can in the head section...
<head>
<script>
if (document.location.protoco l.toLowerC ase() == "http:") {
document.location.replace( (document. location.t oString(). replace(/^ (http)/, "$1s")));
}
</script>
</head>
<head>
<script>
if (document.location.protoco
document.location.replace(
}
</script>
</head>
ASKER
Like this........??????
---------- 12211r.htm ------------
<head>
<script>
if (document.location.protoco l.toLowerC ase() == "http:") {
document.location.replace( (document. location.t oString(). replace(/^ (http)/, "$1s")));
}
</script>
</head>
<HTML>
<body onLoad="SecurePort();">
</body>
<script language="javascript">
/*
*/
function SecurePort()
{
// Initialize variables
strProtocol = location.protocol
strSecureURL = "https://";
strServerName = location.host;
//alert(location.protocol) ;
// Check for http protocol to make sure it's a public request and secure it
if(strProtocol == "http:")
{
strSecureURL = strSecureURL + strServerName;
//alert("redirecting to:" + strSecureURL);
document.location = strSecureURL;
}
}
</script>
</html>
---------- end 12211r.htm ------------
---------- 12211r.htm ------------
<head>
<script>
if (document.location.protoco
document.location.replace(
}
</script>
</head>
<HTML>
<body onLoad="SecurePort();">
</body>
<script language="javascript">
/*
*/
function SecurePort()
{
// Initialize variables
strProtocol = location.protocol
strSecureURL = "https://";
strServerName = location.host;
//alert(location.protocol)
// Check for http protocol to make sure it's a public request and secure it
if(strProtocol == "http:")
{
strSecureURL = strSecureURL + strServerName;
//alert("redirecting to:" + strSecureURL);
document.location = strSecureURL;
}
}
</script>
</html>
---------- end 12211r.htm ------------
<html>
<head>
<script>
if (document.location.protoco l.toLowerC ase() == "http:") {
document.location.replace( (document. location.t oString(). replace(/^ (http)/, "$1s")));
}
</script>
</head>
<body>
</body>
</html>
<head>
<script>
if (document.location.protoco
document.location.replace(
}
</script>
</head>
<body>
</body>
</html>
ASKER
Ok, thanks.
We have another script that redirects .com.au to .com
Will this interfere with the existing script?
We have another script that redirects .com.au to .com
Will this interfere with the existing script?
https://www.experts-exchange.com/questions/24191328/Exchange-2007-IIS-7-owa-redirect.html
https://www.experts-exchange.com/questions/24169035/OWA-not-redirecting-from-HTTP-to-HTTPS.html
https://www.experts-exchange.com/questions/26981110/HTTP-to-HTTPS-OWA-rediction-Exchange-2007-on-2008-R2.html
https://www.experts-exchange.com/questions/26762269/Exchange-2007-OWA-URL-Redirection-HTTP-to-HTTP.html
https://www.experts-exchange.com/questions/24169035/OWA-not-redirecting-from-HTTP-to-HTTPS.html
https://www.experts-exchange.com/questions/26981110/HTTP-to-HTTPS-OWA-rediction-Exchange-2007-on-2008-R2.html
https://www.experts-exchange.com/questions/26762269/Exchange-2007-OWA-URL-Redirection-HTTP-to-HTTP.html
// you can do both together:
var uri = document.location.toString ().replace (/^(http): /, "$1s:");
uri = uri.replace( /\.au\//, "/" )
if ( uri != document.location ) document.location.replace( uri );
var uri = document.location.toString
uri = uri.replace( /\.au\//, "/" )
if ( uri != document.location ) document.location.replace(
ASKER
sorry i'm new to scripting....what should be the complete script?
http://smtp25.blogspot.com/2010/09/owa-2010-enable-redirection-http-to.html