Forum Moderators: open
or Would either of these work?
ASP Redirect
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently";
Response.AddHeader("Location","http://www.example.com/");
%>
ASP .NET Redirect
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.example.com");
}
</script>
I'm trying to find this on my own. If this should be somewhere else, let me know. I'll post it where it needs to go.
Thanks in advance!
Nicci
[edited by: encyclo at 11:23 am (utc) on Nov. 16, 2007]
[edit reason] switched to example.com [/edit]
IIS doesn't use .htaccess, it's an Apache feature.
You can do re-directs using code like your example at the page level. Use a HTTP header checker to confirm it works as expected.
To configure re-directs at the server level on IIS you need access to the IIS MMC or use ISAPI_REWRITE (usually not available on shared hosting).
<%@ Language=VBScript %>
<%
If Request.ServerVariables("SERVER_NAME") <> "www.tribeazure.com" Then
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "http://www.tribeazure.com/"
End If
%>
One of the guys on another of my forums finally got it for me. Maybe this will be of some help to someone else.
Best, Nicci