You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tim Luoma <lu...@peak.org> on 2002/07/19 02:40:29 UTC

content negotiation examples

I've been looking around for some clear example of how to do something 
very simple (I think) but I can't figure out how to do it.

In every folder on my site I will have a PNG and a (gif or jpg) of the 
same image with the same filename.

I want to use content negotiation to feed the correct page depending on 
the capabilities of the browser.

There are a lot of example sites out there that talk about this idea, 
but I didn't find any examples that I could follow for sitewide 
configuration.

TjL




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: content negotiation examples

Posted by Tim Luoma <lu...@peak.org>.
Joshua Slive wrote:

> This is discussed in detail at
> http://httpd.apache.org/docs-2.0/content-negotiation.html
> 
> The two choices are type-maps and multiviews.  The first is faster at
> run-time, while the second is usually quicker to setup.
> 
> Assuming you want the second, it is probably as easy as adding
> "Multiviews" to your Options lines and then referring to the images
> without their file extensions.  So, for example, if you have an
> image01.jpg and image01.png in the root directory of your site, then
> reference them as <img src="image01">.
> 
> Now, exactly what effect this will have depends on how the browser has its
> Accept lines configured.

Multiviews... ah.... I was thrown by this line:

	MultiViews is a per-directory option

I (stupidly) didn't realize that the directory could be /

duh

Thanks, that was very easy once I knew what I was doing.

TjL




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: content negotiation examples

Posted by Joshua Slive <jo...@slive.ca>.
On Thu, 18 Jul 2002, Tim Luoma wrote:

> I want to use content negotiation to feed the correct page depending on
> the capabilities of the browser.

This is discussed in detail at
http://httpd.apache.org/docs-2.0/content-negotiation.html

The two choices are type-maps and multiviews.  The first is faster at
run-time, while the second is usually quicker to setup.

Assuming you want the second, it is probably as easy as adding
"Multiviews" to your Options lines and then referring to the images
without their file extensions.  So, for example, if you have an
image01.jpg and image01.png in the root directory of your site, then
reference them as <img src="image01">.

Now, exactly what effect this will have depends on how the browser has its
Accept lines configured.

Joshua.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org