Redirecting URLs using Classic ASP in Cloud Sites
This article provides sample code for redirecting URLs in Cloud Sites using Classic ASP. This can be used for redirecting to a different page or forcing a secure connection (SSL).
The code below provides an example of redirecting URLs in Cloud Sites using Classic ASP. This can be used for redirecting to a different page or forcing a secure connection (SSL).
Note: |
| The code provided below is only an example. Your specific website may require different code. As outlined in our Terms of Service and Cloud Sites Spheres of Support Expectations, we are unable to help you troubleshoot code issues. We recommend speaking with your developer before implementing any scripts. |
<% Response.Buffer = True
If (Request.ServerVariables("HTTP_CLUSTER_HTTPS") <> "on") Then
If IsEmpty(Request.ServerVariables("HTTP_CLUSTER_HTTPS")) Then
Dim xredir__, xqstr__
xredir__ = "https://" & Request.ServerVariables("SERVER_NAME") & _
Request.ServerVariables("SCRIPT_NAME")
xqstr__ = Request.ServerVariables("QUERY_STRING")
If xqstr__ <> "" Then xredir__ = xredir__ & "?" & xqstr__
Response.Redirect xredir__
End If
End If
Response.Write("SSL Only")
%>