Ubuntu Geek

Ubuntu Linux Tips,Howtos&Tutorials|Edgy,Feisty,Gutsy,Hardy,Intrepid

  • RSS Feed

    subscribe to the ubuntu Geek RSS feed


  • Sponsor



  • Categories

  • Meta

  • Sponsor

  • Archives

  • Support Ubuntugeek

    Amount $:
    Website(Optional):


  • Favourite Sites

How to change apache2 default charset in Ubuntu

Posted by admin on February 24th, 2008 Email This Post Email This Post

If you want to change the apache2 default charset in Ubuntu try this procedure

You need to edit this file /etc/apache2/conf.d/charset

sudo gedit /etc/apache2/conf.d/charset

next you should change the line

#AddDefaultCharset ISO-8859-1

to

AddDefaultCharset {YOUR_DEFAULT_CHARSET | Example: UTF-8}

save and exit the file

Now you need to restart the apache server using the following command

sudo /etc/init.d/apache2 restart

Share/Save/Bookmark

If you want to be notified the next time we write something please subscribe to our RSS feed.Thanks for Visiting!

Related Articles

2 Responses to “How to change apache2 default charset in Ubuntu”

  1. Anders Says:

    Thanks! :) I have been struggling with this for a time.

  2. Martijn Says:

    Be careful with this one since it can bite you.
    According to the Apache manual:

    AddDefaultCharset should only be used when all of the text resources to which it applies are known to be in that character encoding and it is too inconvenient to label their charset individually.

    It even overrides the content-type meta tags in the body of a page. I don’t think this makes sense, but that’s how it works.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>