Charset - htaccess question

  • Thread starter Samuël van Laere
  • Start date
S

Samuël van Laere

My html files each contain this line:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

Now i'm also using .htaccess, and one of those line reads like this:
AddType text/html;charset=iso-8859-1 .htm

I'm asuming that i can remove the charset lines of the html files,
since there is no need for them anymore?
Or shouldn't i remove them?
 
G

Geoff Ball

Samu� van Laere said:
My html files each contain this line:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
Now i'm also using .htaccess, and one of those line reads like this:
AddType text/html;charset=iso-8859-1 .htm
I'm asuming that i can remove the charset lines of the html files,

Yes, you can. The meta content type doesn't really work anyway, as the
server must send the content type header before any of the body is sent.
Its only real use is with the W3 Validator.

And once you do take it out, go to http://www.delorie.com/web/headers.html,
and make sure your server is sending the correct headers.

Regards,
Geoff
 
S

Samuël van Laere

Geoff Ball said:
Samu? van Laere wrote:
Yes, you can. The meta content type doesn't really work anyway, as the
server must send the content type header before any of the body is sent.
Its only real use is with the W3 Validator.

And once you do take it out, go to http://www.delorie.com/web/headers.html,
and make sure your server is sending the correct headers.

So i can test if the iso-8859-1 charset was sent by using the link you
provided?
I do not know a lot about http, headers and such so excuse me for asking
this.

(Perhaps it will help me to understand how this stuff works, when i read
about http specification.
I did read some parts of it a long time ago, and if i remember correctly it
was a masive textfile to
i suppose that is why i didn't read all of it.)
 
G

Geoff Ball

Samu� van Laere said:
"Geoff Ball" <[email protected]> schreef in bericht
Thanks for your answer Geoff,
I think i just leave those meta tags in, since the W3 Validator seems to
use them anyway.

The Validator only uses the meta tag's value if one isn't sent by the
server. Since you're sending one, it will use that instead of the one in
your meta tag.
Perhaps they are not usefull (anymore) but it doesn't hurt to keep them i
asume.

It's not necessary to keep the meta content-type, and you can actually
confuse the validator if the meta and server content types conflict. I
suggest you take it out.

Regards,
Geoff
 
G

Geoff Ball

Samu� van Laere said:
"Geoff Ball" <[email protected]> schreef in bericht


So i can test if the iso-8859-1 charset was sent by using the link you
provided?

Yup. If you post your URL, I or someone else can let you know if it's
working.

Regards,
Geoff
 
G

Geoff Ball

Toby said:
I wouldn't remove them. They're still useful if a user saves them to disk
and later opens them.

I don't know if they would be, other than informing the person what the
suggested content-type was on the server. I don't know of any OS that would
use the meta element in an HTML file to serve the document properly.

Although I know what you're getting at, I don't see any logical use of the
meta content type.

Regards,
Geoff
 
T

T. Audry Glamour

Samuël van Laere said:
So i can test if the iso-8859-1 charset was sent by using the link you
provided?
I do not know a lot about http, headers and such so excuse me for asking
this.

I am glad you asked because I didn't understand, either.

Now I would like to know how does one get the server to send the
correct information? Is this something I can configure myself or is it
something I have to contact my web hosting company about? I am about
to change from a large faceless who-do-I-contact place to a smaller
one where I should have no trouble requesting...I just need to know
what to ask for. :)

Thanks for any suggestions from anyone--and thanks so much, Samuël,
for starting this discussion.

Audry
 
T

Toby A Inkster

I don't know if they would be, other than informing the person what the
suggested content-type was on the server. I don't know of any OS that would
use the meta element in an HTML file to serve the document properly.

No, but the browser could use it to interpret the file in the absence of
any HTTP headers.
 
S

Samuël van Laere

T. Audry Glamour said:
I am glad you asked because I didn't understand, either.

Now I would like to know how does one get the server to send the
correct information? Is this something I can configure myself or is it
something I have to contact my web hosting company about? I am about
to change from a large faceless who-do-I-contact place to a smaller
one where I should have no trouble requesting...I just need to know
what to ask for. :)

Thanks for any suggestions from anyone--and thanks so much, Samuël,
for starting this discussion.

Audry


Well it only works if you have access to your server's .htaccess file,
if you are not sure about this contact your webhost and ask them.
You can allways try this by using a text editor and adding this line:

AddType text/html;charset=iso-8859-1 .htm

Then just save this file to: .htaccess (notice the single dot!) and upload
it
to the server.


- Some usefull links -
http://apache-server.com/tutorials/ATusing-htaccess.html
http://httpd.apache.org/docs/howto/htaccess.html
http://javascriptkit.com/howto/htaccess.shtml
 
T

T. Audry Glamour

Samuël van Laere said:
Well it only works if you have access to your server's .htaccess file,
if you are not sure about this contact your webhost and ask them.

Ah ha! Thanks. I've already played around with .htaccess (for custom
404 error messages). Apparently I'm unable to do anything with
..htaccess where I'm hosted now. But when I switch to a new host I will
be able to. I will go read up on it.

:)

Audry
 

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
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top