469,951 Members | 2,658 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,951 developers. It's quick & easy.

Response.Addheader

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"
:
%>

Jun 27 '08 #1
8 8155

"Tony" <To*****@yahoo.comwrote in message
news:Og**************@TK2MSFTNGP03.phx.gbl...
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.
Jun 27 '08 #2
"Bob Milutinovic" wrote:
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).
On a side note, you can add a [Headers] tab to the [Page Info] window in
Firefox, by adding the "Live HTTP Headers" extension:
https://addons.mozilla.org/en-US/firefox/addon/3829

In addition, you can use the extension to capture a log of all[1]
request/response headers, and use its "replay" feature to tweak your request
headers before re-submitting a request (this includes all headers and even
POST body content).

[1] You can filter out immaterial request info, such as image and css
requests

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.

Jun 27 '08 #3
"Bob Milutinovic" wrote...
>
"Tony" wrote ...
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.
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.


Jun 27 '08 #4
"Tony" wrote...
:You can modify some HTTP meta response by adding comments within the <HEAD></HEAD>
section.
Sorry spellcheck.

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


Jun 27 '08 #5
"Tony" wrote:
My original question, is do search bots bother to read the
HTTP headers for a robots name/content pair.
You might just as well ask if they bother to read the META tag versions.
When we went through the process of selecting a search appliance for our
internal servers, several vendors confessed to us that they do not obey such
tags.
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.

Jun 27 '08 #6
"Tony" <To*****@yahoo.comwrote in message
news:ek**************@TK2MSFTNGP05.phx.gbl...
"Bob Milutinovic" wrote...

"Tony" wrote ...
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.

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'.
>

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.
The actual header you are after is X-Robots-Tag :-

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


--
Anthony Jones - MVP ASP/ASP.NET
Jun 27 '08 #7
"Anthony Jones" wrote...
:
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"
Ah HA!

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

THANKS, Anthony!!!

Tony

Jun 27 '08 #8
Gazing into my crystal ball I observed "Tony" <To*****@yahoo.com>
writing in news:ek**************@TK2MSFTNGP05.phx.gbl:
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 --->

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Jun 27 '08 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Craig Haywood | last post: by
reply views Thread by S.Kartikeyan | last post: by
4 posts views Thread by Adam Beer | last post: by
1 post views Thread by Sridhar | last post: by
6 posts views Thread by john | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.