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.
Add “AddDefaultCharset ISO-8859-1” (without the quotes) as a line in your .htaccess file.
How do I see the .htaccess file? Where would it be located?
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").
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.
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.
Thanks very much. One very last question. Was I likely to have overwritten an important default .htaccess in my home directory root?
It is possible, but your FTP app should have warned you.
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.
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.