You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "oxfordmusic.net" <li...@oxfordmusic.net> on 2004/09/24 16:54:01 UTC

[users@httpd] [newbie] Content negotiation problem

This may be a simple problem but I've been scratching my head all day about 
it. Tried searching via google and the list archives but couldn't find an 
answer.

I am trying to set up Content negotiation on a RHEL3 box with   Apache 
version 2.0.46.
The idea is that all URLs on the site will have no extension to match up to 
files on the server with a .host extension.
My virtual server container looks like this:
<VirtualHost *:80>
DocumentRoot /var/www/html/www
ServerName host.mydomain.com
ServerAlias host.mydomain.com
AddHandler type-map .var
AddType application/x-type-map .var
ErrorDocument 404 /index.host
DirectoryIndex index
</VirtualHost>

And /var/www/html/www/faqs.var:
URI: faqs

URI: faqs.host
Content-type: text/html; qs=1

When I hit http://host.mydomain.com/faqs, I get the index page (because it's 
the error page) but when I hit http://host.mydomain.com/faqs.host I get the 
content of my faqs.host page as intended.

Can anyone point out where I'm going wrong? I was under the impression from 
the docs on the website that all I had to do was add "AddHandler type-map 
.var" into my httpd.conf file and create .var files for each resource.

Cheers

Andy 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] [newbie] Content negotiation problem

Posted by Joshua Slive <js...@gmail.com>.
On Mon, 27 Sep 2004 14:29:40 +0100, oxfordmusic.net
<li...@oxfordmusic.net> wrote:
> >> >> You need to request faqs.var.  If you want it to work without the
> >> >> extension, you need to activate the Multiviews option (in which case
> >> >> you could probably do without the type-map anyway), or you need to
> >> >> rename your file to not have the extension and usee a SetHandler
> >> >> directive to mark it as a type-map.
> >> >>
> >> >
> >>  nope, that doesn't work i'm afraid.
> >
> > What doesn't work?  I made at least three different suggestions above.
> >
> 
> sorry, i wasn't very specific. i've added "Options +MultiViews" to the vHost
> container in httpd.conf and renamed faqs.var as faqs. when i request
> http://host.mydomain.com/faqs i just get the contents of the type-map file
> in the browser. it works fine when i request the actual .var file but i
> don't want my urls to have .var in.

You don't to do both.  EITHER use multiviews or rename the files.

> if i use SetHandler, then that will define the Handler for all the files in
> that location right? how do i define different Handlers for files with
> extensions and files without extensions?

<Files faqs>
SetHandler type-map
</Files>

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] [newbie] Content negotiation problem

Posted by "oxfordmusic.net" <li...@oxfordmusic.net>.
>> >> You need to request faqs.var.  If you want it to work without the
>> >> extension, you need to activate the Multiviews option (in which case
>> >> you could probably do without the type-map anyway), or you need to
>> >> rename your file to not have the extension and usee a SetHandler
>> >> directive to mark it as a type-map.
>> >>
>> >
>>  nope, that doesn't work i'm afraid.
>
> What doesn't work?  I made at least three different suggestions above.
>

sorry, i wasn't very specific. i've added "Options +MultiViews" to the vHost 
container in httpd.conf and renamed faqs.var as faqs. when i request 
http://host.mydomain.com/faqs i just get the contents of the type-map file 
in the browser. it works fine when i request the actual .var file but i 
don't want my urls to have .var in.

if i use SetHandler, then that will define the Handler for all the files in 
that location right? how do i define different Handlers for files with 
extensions and files without extensions?

i got this working on a RaQ4 (Apache 1.3) just by adding the .var files into 
the directory.

cheers

andy



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] [newbie] Content negotiation problem

Posted by Joshua Slive <js...@gmail.com>.
On Fri, 24 Sep 2004 17:17:05 +0100, oxfordmusic.net
<li...@oxfordmusic.net> wrote:

> >> You need to request faqs.var.  If you want it to work without the
> >> extension, you need to activate the Multiviews option (in which case
> >> you could probably do without the type-map anyway), or you need to
> >> rename your file to not have the extension and usee a SetHandler
> >> directive to mark it as a type-map.
> >>
> >
>  nope, that doesn't work i'm afraid.

What doesn't work?  I made at least three different suggestions above.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] [newbie] Content negotiation problem

Posted by "oxfordmusic.net" <li...@oxfordmusic.net>.
>>> I am trying to set up Content negotiation on a RHEL3 box with   Apache
>>> version 2.0.46.
>>> The idea is that all URLs on the site will have no extension to match up 
>>> to
>>> files on the server with a .host extension.
>>> My virtual server container looks like this:
>>> <VirtualHost *:80>
>>> DocumentRoot /var/www/html/www
>>> ServerName host.mydomain.com
>>> ServerAlias host.mydomain.com
>>> AddHandler type-map .var
>>> AddType application/x-type-map .var
>>
>> The AddType should not be needed.
>>
>>> ErrorDocument 404 /index.host
>>> DirectoryIndex index
>>> </VirtualHost>
>>>
>>> And /var/www/html/www/faqs.var:
>>> URI: faqs
>>>
>>> URI: faqs.host
>>> Content-type: text/html; qs=1
>>>
>>> When I hit http://host.mydomain.com/faqs, I get the index page (because 
>>> it's
>>> the error page) but when I hit http://host.mydomain.com/faqs.host I get 
>>> the
>>> content of my faqs.host page as intended.
>>
>> You need to request faqs.var.  If you want it to work without the
>> extension, you need to activate the Multiviews option (in which case
>> you could probably do without the type-map anyway), or you need to
>> rename your file to not have the extension and usee a SetHandler
>> directive to mark it as a type-map.
>>
>
 nope, that doesn't work i'm afraid.

FWIW, the error in the logs is as follows:
[Fri Sep 24 17:09:07 2004] [error] [client my.ip.ad.ress] File does not 
exist: /var/www/html/www/faqs
and if i do a ls /var/www/html/www/faqs*:
/var/www/html/www/faqs.var
/var/www/html/www/faqs.wgt

what puzzles me is i've got this working on a Cobalt RaQ4 (based on RH6, 
Apache 1.3) just by adding the *.var files to the right directory.

cheers

andy





---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] [newbie] Content negotiation problem

Posted by "oxfordmusic.net" <li...@oxfordmusic.net>.
>> I am trying to set up Content negotiation on a RHEL3 box with   Apache
>> version 2.0.46.
>> The idea is that all URLs on the site will have no extension to match up 
>> to
>> files on the server with a .host extension.
>> My virtual server container looks like this:
>> <VirtualHost *:80>
>> DocumentRoot /var/www/html/www
>> ServerName host.mydomain.com
>> ServerAlias host.mydomain.com
>> AddHandler type-map .var
>> AddType application/x-type-map .var
>
> The AddType should not be needed.
>
>> ErrorDocument 404 /index.host
>> DirectoryIndex index
>> </VirtualHost>
>>
>> And /var/www/html/www/faqs.var:
>> URI: faqs
>>
>> URI: faqs.host
>> Content-type: text/html; qs=1
>>
>> When I hit http://host.mydomain.com/faqs, I get the index page (because 
>> it's
>> the error page) but when I hit http://host.mydomain.com/faqs.host I get 
>> the
>> content of my faqs.host page as intended.
>
> You need to request faqs.var.  If you want it to work without the
> extension, you need to activate the Multiviews option (in which case
> you could probably do without the type-map anyway), or you need to
> rename your file to not have the extension and usee a SetHandler
> directive to mark it as a type-map.
>

nope, that doesn't work i'm afraid.

andy 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] [newbie] Content negotiation problem

Posted by Joshua Slive <js...@gmail.com>.
On Fri, 24 Sep 2004 15:54:01 +0100, oxfordmusic.net
<li...@oxfordmusic.net> wrote:

> I am trying to set up Content negotiation on a RHEL3 box with   Apache
> version 2.0.46.
> The idea is that all URLs on the site will have no extension to match up to
> files on the server with a .host extension.
> My virtual server container looks like this:
> <VirtualHost *:80>
> DocumentRoot /var/www/html/www
> ServerName host.mydomain.com
> ServerAlias host.mydomain.com
> AddHandler type-map .var
> AddType application/x-type-map .var

The AddType should not be needed.

> ErrorDocument 404 /index.host
> DirectoryIndex index
> </VirtualHost>
> 
> And /var/www/html/www/faqs.var:
> URI: faqs
> 
> URI: faqs.host
> Content-type: text/html; qs=1
> 
> When I hit http://host.mydomain.com/faqs, I get the index page (because it's
> the error page) but when I hit http://host.mydomain.com/faqs.host I get the
> content of my faqs.host page as intended.

You need to request faqs.var.  If you want it to work without the
extension, you need to activate the Multiviews option (in which case
you could probably do without the type-map anyway), or you need to
rename your file to not have the extension and usee a SetHandler
directive to mark it as a type-map.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org