Forum Moderators: open

Message Too Old, No Replies

modify header sent to browser

Is it possible?

         

macrost

2:04 pm on Dec 16, 2003 (gmt 0)

10+ Year Member



I have followed oogachaka's [webmasterworld.com] way of url rewriting in classic asp by using a custom 404 page. Not too bad!

Now you are probably wondering why I just don't use a custom component, but my host does't allow it. I actually enjoy my host, so it doesn't bother me all to much.

I have the server send a 200 status, which works fine, but the browser still sees a 404 error. I need to be able to send the browser a 200 if it's a good page, as I still worry that a spider might look at browser headers also.

Any ideas are appreciated,

Mac

korkus2000

2:11 pm on Dec 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to change the status right? From a 404 to a 200? I believe this will work. The status string may not be right so I would check the actual 200 response string. Make sure this is the first line on the page to be sent to the browser.

<%
Response.status = "200 OK"
Response.end
%>

macrost

2:17 pm on Dec 16, 2003 (gmt 0)

10+ Year Member



Korkus,
Yes, that's right, however, the browser's querystring when your write it out will still show:
404;http://www.example.com/something.asp?var1=asdf&var2=qwerty

I need to change that 404 to a 200.

In the code that I've used, by checking with the spider sim (thanks Brett!) the server returns a 200.

I hope I've explained this! :)

Mac

macrost

3:57 pm on Dec 16, 2003 (gmt 0)

10+ Year Member



Ok, after some googling (jeez, gotta love that verb!) I came across this:
http*//groups.google.com/groups?q=modify+browser+header+using+asp&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=eboCyHmMBHA.2112%40tkmsftngp02&rnum=15

and hope that this will work:


<% Response.AddHeader "200", "OK" %>

I just don't think that's the ticket right there. <thinking>It doesn't seem right...</thinking>

macrost

3:25 pm on Dec 17, 2003 (gmt 0)

10+ Year Member



Well trying to use the add.responseheader didn't work... any more thoughts?

Mac

RossWal

5:28 pm on Dec 17, 2003 (gmt 0)

10+ Year Member



Would a response.clear purge the 404?

macrost

5:52 pm on Dec 17, 2003 (gmt 0)

10+ Year Member



RossWal,
Good thought, let me check.

Mac
<added>
Nope, still 404;http://www.domain.com:80/more/pageid/2/browseid/289814/product/cookware
</added>

ClickMagazine

7:18 pm on Dec 19, 2003 (gmt 0)

10+ Year Member



Just a little off topic FYI. I also followed some of the advice here to use the 404 error page to create static pages.

Make sure you have a robots.txt, even if it's blank. Otherwise your bots will all get a 500 error. I learned that one the hard way.