Forum Moderators: open
They are saying that it is an empty redirect.
I see my programmer is using a html redirect, but is also sending the 301 status. Below is the code. Is this correct or should I be using something different so google will not consider these empty redirects?
IF EMPTY(pcitemno)
pcnewitemno=IIF(SEEK(UPPER(PADR((Request.QueryString("itemno")),20)), "dbpaitic", "olditemno"), ALLTRIM(dbpaitic.newitemno), "")
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.com/moreinfo.int?itemno=]+pcnewitemno+[ ></html>])
RETURN
ELSE
I have tried to add a different redirect besides a http and i get syntax errors each time. Any ideas?
IF EMPTY(pcitemno)
pcnewitemno=IIF(SEEK(UPPER(PADR((Request.QueryString("itemno")),20)), "dbpaitic", "olditemno"), ALLTRIM(dbpaitic.newitemno), "")
IF !EMPTY(pcnewitemno)
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.mysite.com/moreinfo.int?itemno=" + pcnewitemno"
RETURN
ELSE
If the server is returning a 301 and then a 200 to the proper destination URI, why do you need to change it? When you say Google doesn't like them, exactly what do you mean. Did Googlebot send you a Dear John Letter or something? ;)
Version 5.0 introduces a new Web Control Framework similar to ASP.NET, that lets you use the rich visual designers in Visual Studio and other tools, yet write all your processing logic with FoxPro code.
I would advise to try the WebConnection Support:
[west-wind.com...]
or, try contacting the programmer as PageOneResults said.
Isnt my programming allready sending the status below:
IF EMPTY(pcitemno)
pcnewitemno=IIF(SEEK(UPPER(PADR((Request.QueryString("itemno")),20)), "dbpaitic", "olditemno"), ALLTRIM(dbpaitic.newitemno), "")
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.com/moreinfo.int?itemno=]+pcnewitemno+[ ></html>])
RETURN
ELSE
**It seems to me the issue is with the meta redirect?
It seems to me the issue is with the meta redirect?
That could be the issue and that is why you'll need to get the original programmer involved to make the changes you require. It appears that there are not many here who understand the logic above or they know it is best left to the inventor as there may be some other things that need to change. So, my advice is still to get the programmer on the horn and have the changes made.
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "/new-page.asp"
%> For ASP.NET...
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","/new-page.aspx");
}
</script> What you are presenting above appears to be something that few of us here are familiar with. Again, back to the original programmer for changes. Just tell him that the page must return a 301 > 200 without any meta refreshes, etc.
You've got a whole lot of code up there to do something fairly simple. Also, we don't know exactly what that code "should" be doing. So, the examples I've posted above may not be the solution.
oHeader.redirect("http://www.mysite.com/moreinfo.int?itemno="+pcnewitemno)
just before oHeader.CompleteHeader()
and then remove the line:
Response.WriteLn([<html><meta http-equiv="refresh"content="0;url=http://www.mysite.com/moreinfo.int?itemno=]+pcnewitemno+[ ></html>])
Hers is some more info on what is possible with the wwHTTPHeader class:
[west-wind.com...]
Good luck
Thanks for the post! That seems to be what I was looking for. I added that OHeader.redirect and it seems to be functioning properly. However, if I run a test with a header check tool, its returning a 302 moved response. See below:
#1 Server Response: [mysite.biz...]
HTTP Status Code: HTTP/1.1 302 Moved
Connection: close
Date: Wed, 02 Jul 2008 19:26:31 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Content-type: text/html
Location: [mysite.biz...]
Redirect Target: [mysite.biz...]
Why is it saying I have a 302 response, I clearly send a 301 ?
Any ideas on why the 302 is coming through?