Forum Moderators: open
IF !EMPTY(pcnewitemno)
oHeader = CREATE("wwHTTPHeader",Response)
oHeader.setprotocol([HTTP/1.1 301 object permanently moved])
oHeader.CompleteHeader()
Response.WriteLn([<html><meta http-equiv="refresh"content="0;url=http://www.mysite.biz/moreinfo.int?itemno=]+pcnewitemno+[ ></html>])
Tedster told me this, "Note that the server header is not the same as the <head> section of the page's source code - they are two different critters altogether.
This means that writing a few lines containing a meta refresh into the page's <head> section is not the same as returning the new "Location:" in the server header. Because there's a 301 http status in the server header, your server will never give googlebot the original url's content - and that's where your script is writing the lines that contain the meta refresh."
So how would i send location so it gets redirected to that?
Thanks
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "/new-page.asp"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
That would be the "Poor Man's" solution but it works just fine. If you've got a large volume of pages, it may not be the best solution.
And, if you are on a .NET platform, you can use this at the "page level"...
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","/new-page.asp");
}
</script> I've not seen the type of code example you provided above. Are you doing redirects through a .NET routine?
If you have a large volume of redirects and/or need to maintain them regularly, I'd recommend a rewrite solution like ISAPI_Rewrite to handle this for you. It can become quite tedious trying to do this using the "page level" solution and we've found the .NET rewrite facilities to be not as robust as we need them to be.