How to apply Apache directives to 'dynamic' HTML?

Mike Wright mike.wright at mailinator.com
Wed Oct 10 16:45:58 UTC 2007


Chris G wrote:
> On Wed, Oct 10, 2007 at 11:03:48PM +0930, Tim wrote:
> 
>>On Wed, 2007-10-10 at 08:44 +0100, Chris G wrote:
>>
>>>By default on Fedora 7 the
>>>apache httpd.conf file has:-
>>>    AddDefaultCharset UTF-8
>>>which sets UTF-8 for *everything* served by that apache installation 
>>
>>Unless countermanded...  I's only a "default."  I certainly get
>>different character sets if I do the trick where you play with
>>filenames.
>>
>>e.g. testpage.html.iso88591 and I've set a directive so that file
>>suffixe has meaning.
>>
> 
> OK, you can override it using apache directives (I assume that's what
> you mean), but it (the AddDefaultCharset) overrides anything else set
> by 'client' code as it were.
> 

Hi Chris,

The default can be overridden.  Here's another way.  Let's assume the 
script's name is test and is in /var/www/cgi-bin:

<Directory /var/www/cgi-bin>
   <Files test>
     AddDefaultCharset	ISO-8859-1
   </Files>
</Directory>

Tested in Apache/2.2.6 (unix)

hth,
Mike Wright :m)




More information about the fedora-list mailing list