[thelist] web page extensions

hpoe evolt at webmediaconception.com
Sun Jul 28 00:17:01 CDT 2002


In response to a message [Mark Joslyn] sent [10:42 25.07.02 -0700]:

>My question: How do you set up your pages and/or directory structure to take
>advantage of being able to use links without extensions? This is really
>useful in marketing/advertising pieces.

One thing that has not been mentioned yet is Content Negotiation.
Apache can be configure so that you don't have to use file extension this way.

What it then does is look at all the files available with a given name, and
choose one in accordance with the HTTP_ACCEPT header sent by the browser.

This way you can also serve up multilingual content depending on browser
language settings.

What (obviously) makes this interesting besides the language specific stuff
is that you can mix file extension, and later on change them without
braking any links.


To set up Content Negotiation you need the following directives in either
the http.conf or your .htaccess:

------------------------------------

# turn on Content Negotiation:
      Options FollowSymLinks MultiViews

# in case of language negotiation,
# specify language variants
      AddLanguage en .en
      AddLanguage es .fr
      LanguagePriority en fr

# specify fallback files to choose from
      DirectoryIndex index.en.html index.es.html index.html index
# or e.g.
      DirectoryIndex index.html.en index.html.fr index.html index

------------------------------------
To see the effect go to http://httpd.apache.org/docs/server-wide

Now set your browser's language prefs to: French[fr], English[en], and reload.
Next set them to Spanish[es], English[en]

The documents actually available are
server-wide.html.en and
server-wide.html.fr

Documentation is under http://httpd.apache.org/docs/content-negotiation

hpoe

--
Henning Poerschke:  http://webmediaconception.com




More information about the thelist mailing list