Someone wrote this code for me:
<%@ Language=VBScript %>
<%
CONST CANONICALURL = "www.tribeazure.com"
If Request.ServerVariables("SERVER_NAME") <> CANONICALURL Then
Dim HeaderValue
If Request.ServerVariables("HTTPS") = "off" Then
HeaderValue = "http://" & CANONICALURL
Else
HeaderValue = "https://" & CANONICALURL
End If
If Len(Request.ServerVariables("SCRIPT_NAME")) > 0 Then
HeaderValue = HeaderValue & Request.ServerVariables("SCRIPT_NAME")
End If
If Len(Request.ServerVariables("QUERY_STRING")) > 0 Then
HeaderValue = HeaderValue & "?" & Request.ServerVariables("QUERY_STRING")
End If
Response.Clear
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", HeaderValue
Response.End
End If
%>
It appears to do the job correctly but someone told me I am playing with fire by adding codes such as this to my site. I think he was talking about SEO. Anyway my rankings have dropped drastically. Could this have something to do with it? I'm open to hearing anyone's opinion.
Thanks! Nicci