[OnCloud] Create 301 redirects in onCloud

Create Redirects on your Windows IIS Website

The following ASP .NET script can be placed in a .aspx file to create a 301 redirect:

<script language="C#" runat="server">

private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://myhosting.com");
Response.End();
}
</script>

If you are using Classic ASP, you can use the following script placed in a .asp file to create a 301 redirect:

<%@ Language="VBScript" %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://myhosting.com"
Response.End
%>

Alternatively, you can use an HTML based redirect using <meta> tags to do the same thing. Save this script as a .htm or .html file to create a 301 redirect:

<meta http-equiv="refresh" content="0; url=http://myhosting.com">
</head>
<body>
</body>
</html>

Was this article helpful?
1 out of 2 found this helpful