SimplyWebHosting.com KnowledgeBase Glossary    Contact Us
Search  
   
Browse by Category
SimplyWebHosting.com KnowledgeBase .: Virtuozzo and OpenVz Based Accounts .: How to change the default character set for a website

How to change the default character set for a website

To change the default character set for all sites on a Apache web server, you will need to edit the Apache configuration file (/etc/httpd/conf/httpd.conf). Find the line that starts with "AddDefaultCharset" and change the character set to the one you wish to use.

For example, on a Fedora Core 1 VPS by default this line would read:

AddDefaultCharset UTF-8

If all your websites were in Spanish, you would most likely wish to change this to the Latin-1 character set (ISO-8859-1) like this:

AddDefaultCharset ISO-8859-1

You would then need to save the Apache configuration file and then restart the Apache web server. On a VPS hosting account, you can restart the Apache web server in the HSPC control panel at System tab > Server Management > Web Server. Click on the Restart button to restart Apache.

But what if only some of your sites are in Spanish? To change the default character set for a single site you will need to create a file named ".htaccess" in the root web directory for the site. In most cases, this location will be at /home/siteadminuser/sitename.com/html. Substitute the actual site admin user for "siteadminuser". Substitute the actual sitename for "sitename.com". In that .htaccess, place one line that reads:

AddDefaultCharset ISO-8859-1

If the .htaccess file already exists, you can add the above line to that configuration file.


How helpful was this article to you?

Related Articles

article Can I change the default starting file for my website (i.e. index.php instead of index.html)?
The easiest way is to simply rename or remove...

  7-24-2005    Views: 26015   
article How do I change Apache's default language?
To globally change your Apache web server...

  3-28-2006    Views: 22679   
article I just set up a domain, and it displays as a default page saying "This is the Server Administratorô default page." What does this mean?
You will get this webpage if you attempt to...

(No rating)  11-14-2005    Views: 5590   

User Comments

No comments have been posted.


.: Powered by Lore 1.5.4
Copyright 2005-2014 Advantagecom Networks, Inc.
SimplyWebHosting.com - Xen Linux Virtual Private Servers (VPS) - Paypal Accepted