Quick Nav:  Online Store   |   Login | Register

Forcing a 404 status from PB

Rate this topic:

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
AuthorMessages
DavidWSnow
<250Posts
Posts:213


09/18/2008 9:04 PM  

I have a ListX problem where when someone does a query for a that returns no value.  ie they referenced a page of my data that notlonger exists, I produce a page that tells them this and after 15 seconds uses JavaScript to redirect them back to my AFH Locator page.  This works great for people but Google and other search engines keep indexing the page since they got a "200" HTTP status.

It would seem like ListX would have an easy way to do this and a good example, but I can't seem to find one that works.

Then I though about PageBlaster, the Ultimate Swiss Army Knife for the Web. I figured that MAYBE a PageBlaster rule could be crafted that when it saw "PleaseReturn404" in the text PB could return the "404" status.  If so what would such a rule look like? Am I just dreaming?

Hopefully,

DaveS

John Mitchell
Posts:3492


09/18/2008 9:33 PM  
No problem, that tweezer tool would look like this:

SearchFor:

PleaseReturn404


Replace With:

[PB: Response.Status("404 Not Found") ]

[PB: Response.AddHeader("Location","http://www.snapsis.com") ]

[PB: Response.End() ]

DavidWSnow
<250Posts
Posts:213


09/18/2008 9:41 PM  

What does the [PB: Response.AddHeader("Location","http://www.snapsis.com") ] do

Does it redirect to www.snapis.com or is it supposed to be the url of the page that is being 404'd?

/DaveS

PS I love the speed of your replies

John Mitchell
Posts:3492


09/18/2008 9:54 PM  
Thanks, I wish I could always reply right away.

Yes, you'll want to replace the http://www.snapsis.com to the actual location you want to redirect to.
DavidWSnow
<250Posts
Posts:213


09/23/2008 9:38 PM  

Still doesn't work for me. I get a yellow screen complaining about

XML Parsing Error: no element found
Location: http://www.agingsafely.com/listed_homes/datasheet.aspx
Line Number 1, Column 1:

/DaveS

DavidWSnow
<250Posts
Posts:213


09/25/2008 5:03 PM  

I played around some more with this.  Using the code from your manual for a 301 redirect works.  Anything else produces the message above.   Any idea what to do next????

 

/DaveS

John Mitchell
Posts:3492


09/25/2008 5:46 PM  
I'm not sure, can you give me more details about the error? Is it originating in the PageBlaster module?

If you can attach the corresponding config file from the DesktopModules/Snapsis/PageBlaster/Config/PageRules folder I might be able to see what is wrong.
DavidWSnow
<250Posts
Posts:213


09/25/2008 6:31 PM  

I tried to attach a gif of the error. (4.71KB) and the page config file (4.75KB) and your system wouldn't let me since you have a 2KB limit.

 

/DaveS

DavidWSnow
<250Posts
Posts:213


09/28/2008 2:38 PM  

I emailed you the two files to PortalAdmin@Snapsis.com.  I hope you can see an easy fix.

 

/DaveS

John Mitchell
Posts:3492


09/29/2008 4:36 PM  

I don't see a problem with the config file that would cause that error.

I also don't see the location change part in your rule:


I think the XML error you are getting my be in listX. It might be PageBlaster that is causing listX to not be able to use it's own XML file. It also looks like this XML error is on the client (browser) and not on the server.

DavidWSnow
<250Posts
Posts:213


09/29/2008 9:29 PM  

I get the same thing with and without the [PB: Response.AddHeader("Location","http://www.yoururl.com") ]

I left it out because the existing page JavaScript redirects after 10 seconds.

I'll try the rule on a plain html page to see if it works there.  However, the place that I really need it is on the ListX page.

Thanks fopr trying,

/DaveS

DavidWSnow
<250Posts
Posts:213


10/01/2008 8:54 PM  

I did some more testing and this fails on a page with just an HTML/Text module.

The page is http://www.agingsafely.com/help/test_page/testwithpb.aspx 

I am searching for File_Not_Found and am using your excat rule cut and pasted from the forum post.

I get the same xml parsing error:

"XML Parsing Error: no element found
Location: http://www.agingsafely.com/help/test_page/testwithpb.aspx
Line Number 1, Column 1:"

I really need a solution to my 404 problem.  All suggestions are welcome,

/DaveS

DavidWSnow
<250Posts
Posts:213


10/03/2008 4:05 PM  

Have you been able to get your example to work on asimple page?  Shouldn't the statsus to be returned be a simple number "404"? and possible the "response header" be  "404 Not Found"?

/DaveS

John Mitchell
Posts:3492


10/07/2008 12:58 AM  

Ok, I tried setting this up myself and have realized that I wasn't thinking correctly as far as the redirect go goes.

A 404 does not actually redirect a page, but sends back an empty response with a 404 status.
So the Location header being added is not really valid and won't do a redirect.

If you want to redirect google so that it indexes properly then you could do a 301 redirect, but if you just want to send back a 404 response then you can take out the Response.AddHeader Location line.

I didn't recieve any XML errors when I did this rule, so I'm not sure why you are getting your error.

DavidWSnow
<250Posts
Posts:213


10/12/2008 3:40 PM  

I really want to use the JavaScript to do the redirect after 10 seconds like many 404 pages.  I wondered about your redirect in the code.   I need the 404 error to get Google to remove the old page from the index.  What happens now when a paying customer stops paying and I drop them from the web site by clearing their IsHosted bit in the database the ListX query gets no matching results and displays its page for this condition with a status of 200. Google still thinks the URL is good.  I have tried all sorts of ListX tricks to get a 404 status with no luck.  The ListX forum has been silent on my posts.

I would have though that this issue would have occurred to others, but apparently they don't care if Google indexs the cruft on thier site.

 

How would you recommend that the xml error be troubleshot?  Mine is a pretty bland DNN site. I do use ListX, PageBlaster and iFinity Friendly URL.  The xml error occurrs on a plain page with just Text/HTML module and PageBlaster.

Please post your working 404 page code so I can try it, or was it the same as the original without the redirect.

 

/DaveS

John Mitchell
Posts:3492


10/12/2008 5:08 PM  
Yes, my working 404 code was the same as the original post without the Location line.

I'm not sure what is producing that XML error, maybe it is the ListX module?

If you do a 301 instead of returning a 404 it will remove it from Google's index a lot faster and it will also have the advantage of passing any PageRank to the page you redirect to.
DavidWSnow
<250Posts
Posts:213


10/12/2008 7:11 PM  
If I have a page http://www.agingsafely.com/listed_homes/datasheet/vrecordid/434.aspx with a title of
"Brookwood House Inc, Bellevue WA" and I do a 301 redirect to http://www.agingsafely.com/listed_homes.aspx with a title of "Adult Family Home, Locater Tool, Aging Safely", what will Google index? Use the new URL with the new title, description and keywords or just the new URL in place of the old one.

Are you implying that all context from the old Google entry is replaced by the target of the 301?

My only problem with the 301 would be that the user wouldn't ever see why they were being redirected, which is why I was working on the 404 with the JavaScript redirect.

/DaveS
John Mitchell
Posts:3492


10/12/2008 10:00 PM  

Are you implying that all context from the old Google entry is replaced by the target of the 301?

A 301 (permanent) redirect tells the requestor that the resource has been permanently moved to the new location.

I'm not sure how long it takes google to put the new meta information in it's index, but that is the way to make it transfer any PageRank.

I would suggest passing some information on the querysting if you want to indicate on the new page that the old page is no longer there.

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
Forums >Snapsis Product Support >PageBlaster > Forcing a 404 status from PB



ActiveForums 3.7
Powered by: Snapsis Software