Character Encoding

design

#1

In the WDG Character Encoding section it says that one should add (AddType ‘text/html; charset=ISO-8859-1’ html) to the .htaccess file instead of . Apparently my sites won’t validate properly without it. How should I add this to .htaccess ? From looking at DH it seems that .htaccess is about security.
Any help welcome.
Thanks.


#2

Add “AddDefaultCharset ISO-8859-1” (without the quotes) as a line in your .htaccess file.


MacManX.com


#3

How do I see the .htaccess file? Where would it be located?
Thanks.


#4

You’ll have to create it yourself. Just create a plain text document with that line in it and save it as “htaccess” (no dot). Then, upload it to the directory in questions and add a dot in front (".htaccess").


MacManX.com


#5

I tried to create one and put it in root of my home directory underneath which are several domains. I can’t see the file through putty or my FTP program. Do I need a Unix command to show hidden files? I created the file in Notepad copied it by FTP and then using my FTP client I renamed it and then it disappeared.


#6

The file needs to go in one of your site directories (one of the folders named yourdomain.com). To see the .htaccess file, enable hidden files in your FTP app’s preferences.


MacManX.com


#7

Thanks very much. One very last question. Was I likely to have overwritten an important default .htaccess in my home directory root?
Christopher


#8

It is possible, but your FTP app should have warned you.


MacManX.com


#9

If you’ve got a decent text editor (not something from Microsoft that thinks it knows better than you), you can name the file “.htaccess”, with the dot, from the start. I use UltraEdit, for instance.

– Dan


#10

Dtobias, it is true that on any system you can save the file as “.htaccess” first, but on Mac and Linux systems that renders the file invisible to the user. Which, for beginners causes a great deal of confusion for how to upload an invisible file to a webserver. That’s why I suggested to save it as “htaccess” and add the dot after uploading.


MacManX.com