---
title: "Redirecting URLs using Classic ASP in Cloud Sites"
source: "https://docs.nexcess.com/hosting/cloud-sites/asp-net-and-iis/redirecting-urls-using-classic-asp-in-cloud-sites/"
description: "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 secur…"
vertical: "Hosting"
date: "2024-03-04"
last_modified: "2026-06-30"
---

# Redirecting URLs using Classic ASP in Cloud Sites

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](https://www.liquidweb.com/policies/terms-of-service/) and [Cloud Sites Spheres of Support Expectations](https://www.liquidweb.com/help-docs/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")
%>
```
