Forum Moderators: open

Message Too Old, No Replies

meta http-equiv and meta name

What's the difference, and can I get rid of them?

         

encyclo

6:06 pm on Oct 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't like having redundant markup in my HTML, and I've been looking to get rid of stuff like meta tags at the top of my pages - but I'm not sure exactly what the meta tags do. I already define the charset and language in .htaccess, meaning I could get rid of these:

<meta http-equiv="Content-Language" content="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

and still validate.

Now, I would like to replace the following:

<meta http-equiv="imagetoolbar" content="false">
<meta name="MSSmartTagsPreventParsing" content="TRUE">

or even

<meta name="description" content="whatever">

by generating them as headers in, say, PHP. My question is, are meta tags http headers, and what is the difference between the "http-equiv" and "name"? Would my idea work?

RonPK

9:59 pm on Oct 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Quoting the HTML 4.01 specs, section 7.4.4, Meta Data:

The http-equiv attribute can be used in place of the name attribute and has a special significance when documents are retrieved via the Hypertext Transfer Protocol (HTTP). HTTP servers may use the property name specified by the http-equiv attribute to create an [RFC822]-style header in the HTTP response. Please see the HTTP specification ([RFC2616]) for details on valid HTTP headers.

If I understand this correctly, there is not much difference on the WWW between <meta name> and <meta http-equiv>.

Theoretically your idea of replacing meta tags by regular http headers might work. The point is: will user agents interpret it correctly?

From personal experience I know that PICS labels (rating information) can be put in http headers AND still work in IE. But I sincerely doubt that any search engine spider will check the headers for 'description' or 'content'. Maybe you could try to send a imagetoolbar header and see what happens?

AFAIK, 'MSSmartTagsPreventParsing' has not been implemented (yet?) so you can safely leave that out anyway.

encyclo

5:04 pm on Nov 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for your reply RonPK - I interpret the snippet of the HTML specs differently, although I might be wrong (it's rather unclear). The way I read it, only meta http-equiv should be treated as an [RFC822]-style header in the HTTP response, and not meta name. So, sending meta name="description" as an HTTP header wouldn't work.

Notwithstanding, when I sent imagetoolbar:false as a header rather than as a meta tag, IE6 ignores it, despite the fact that the meta tag uses http-equiv. However, sending PICS label as a header is very useful to know!