Forum Moderators: phranque

Message Too Old, No Replies

how to set content-language for certain directories in httpd.conf?

         

bada

5:37 pm on Dec 15, 2006 (gmt 0)

10+ Year Member



I have a server with several domains on it. Most of these sites are english, so the content-language is english in Apache's httpd.conf. However, I have some sites on the server that have french versions. I dont want the language to be detected, instead I have have a folder for english and for french, ie: /en/index.html and /fr/index.html. How can I specify in the httpd.conf that content in the /fr/ directory is to be served with a french content-language header?

<Location www.oneofmysites.com/fr/> AddLanguage fr .html </Location>

or something?

phranque

2:11 am on Dec 16, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



you probably want DefaultLanguage:
[httpd.apache.org...]

bada

9:25 pm on Dec 18, 2006 (gmt 0)

10+ Year Member



No, since I want to sepcify the content-language for certain folders only...

jdMorgan

11:31 pm on Dec 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



From the mod_mime documenttion:
DefaultLanguage Directive

Description:Sets all files in the given scope to the specified language
Syntax:DefaultLanguage MIME-lang
Context:server config, virtual host, directory, .htaccess
Override:FileInfo

You may therefore make the setting inside a <Directory> container in httpd.conf or other server config file, or within a .htaccess file in the filepath of the directory you wish to set the language for. Either method will allow the control you need.

Jim