Response.Addheader

T

Tony

I've searched the web & can't find an answer to this.

Is it possible to successfully use Response.AddHeader for a robots meta tag?

For example, I want to do

<%
IF request("PageID") = 252 THEN Response.AddHeader "robots", "noindex"
:
%>
 
B

Bob Milutinovic

Tony said:
I've searched the web & can't find an answer to this.

Is it possible to successfully use Response.AddHeader for a robots meta
tag?

For example, I want to do

<%
IF request("PageID") = 252 THEN Response.AddHeader "robots", "noindex"
:
%>

It looks like you're confusing response headers with the HTML "head"
section; the two are entirely unrelated.

The response header is the data block sent back to the browser by the web
server which passes things like the result code, cookies, etc., and which
you never get to see (unless you're doing "raw" browsing with something like
SamSpade or Lynx).

The HTML "head" section is actually simply a part of the HTML stream, which
the server pays no attention to as a separate entity from the "body" or any
other part of the stream. It's this location that you'll need to add your
"robots" directive to, as a meta tag (you'll find plenty of references to
the "robots" meta tag using Google).

- Bob.
 
T

Tony

...

It looks like you're confusing response headers with the HTML "head"
section; the two are entirely unrelated.

No, I'm afraid that you are confused.

What you are discussing is correctly called the HTTP Headers, not the "response
headers".

The response header is the data block sent back to the browser by the web
server which passes things like the result code, cookies, etc., and which
you never get to see (unless you're doing "raw" browsing with something like
SamSpade or Lynx).

The HTML "head" section is actually simply a part of the HTML stream, which
the server pays no attention to as a separate entity from the "body" or any
other part of the stream. It's this location that you'll need to add your
"robots" directive to, as a meta tag (you'll find plenty of references to
the "robots" meta tag using Google).

Duh.

You can modify some HTTP meta response by adding comments within the <HEAD></HEAD>
section.

My original question, is do search bots bother to read the HTTP headers for a robots
name/content pair.
 
T

Tony

...
:> You can modify some HTTP meta response by adding comments within the said:

Sorry spellcheck.

That should have read:
You can modify some HTTP meta response by adding CONTENT within the <HEAD></HEAD>
section.
 
A

Anthony Jones

Tony said:
...

No, I'm afraid that you are confused.

What you are discussing is correctly called the HTTP Headers, not the "response
headers".

The term HTTP Headers is general term to the set of headers defined in the
HTTP spec. Some HTTP Headers only have meaning as part of the Request phase
of a HTTP session, some only have meaning in the Response phase and a few
can be used both in the request and the response.

When refering to HTTP headers that are sent as part of the response we tend
to use the phrase 'Response Headers'. The Response.AddHeader is a method in
ASP we use to add such 'Response Headers'.
Duh.

You can modify some HTTP meta response by adding comments within the
section.

My original question, is do search bots bother to read the HTTP headers for a robots
name/content pair.

The actual header you are after is X-Robots-Tag :-

Response.AddHeader "X-Robots-Tag", "noindex"
 
T

Tony

...
:
The actual header you are after is X-Robots-Tag :-

Response.AddHeader "X-Robots-Tag", "noindex"

Ah HA!

And I found a wealth of new information when I searched for "X-Robots-Tag"

THANKS, Anthony!!!

Tony
 
A

Adrienne Boswell

My original question, is do search bots bother to read the HTTP
headers for a robots name/content pair.

The well behaving bots do honor noindex, nofollow within a Meta tag in the
Head element. Some, including Google, also honor rel="nofollow", good if
you want to have a link to an outside host, but do not want SE to follow
it. You will also, if you have not already done so, want make use of a
robots.txt file [www.robotstxt.org/].

Understand that misbehaving bots will ignore all your efforts.

There are helpful people at alt.internet.search-engines that-a-way --->
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,079
Messages
2,570,574
Members
47,206
Latest member
Zenden

Latest Threads

Top