Myreader.co.uk  
uk news, chat and community
   home   |   control panel login   |   archive   |  
 
net
net
news.announce
news.config
news.management
news.moderation
providers
providers.aaisp
web.authoring
  
 
date: Wed, 1 Jul 2009 20:58:30 +0100,    group: uk.net.web.authoring        back       
URL confusion   
Some time ago, I configured the server I use so that the HTML pages
like:

   http://www.westmidlandbirdclub.com/kidderminster/bodenham2008.htm

could be accessed using URLs in the format

   http://www.westmidlandbirdclub.com/kidderminster/bodenham2008

in the meantime I've forgotten how & where I did that - it might even be
that my hosts, Gradwell, did it for me - there's nothing related, in my
.htaccess file

I now have some files at:

   http://www.westmidlandbirdclub.com/kidderminster/bodenham2008.csv
   http://www.westmidlandbirdclub.com/kidderminster/bodenham2008.xcl

However, when I now try to download:

   http://www.westmidlandbirdclub.com/kidderminster/bodenham2008

my browser tries to open the .csv file.

How can I fix that?

-- 
Andy Mabbett
            Says  "NO! to compulsory UK ID Cards":  <http://www.no2id.net/>
            and:  "Free Our Data":  <http://www.freeourdata.org.uk>
                   (both also on Facebook)
date: Wed, 1 Jul 2009 20:58:30 +0100   author:   Andy Mabbett

Re: URL confusion   
On Wed, 1 Jul 2009 20:58:30 +0100, Andy Mabbett
 wrote:

>
>I now have some files at:
>
>   http://www.westmidlandbirdclub.com/kidderminster/bodenham2008.csv
>   http://www.westmidlandbirdclub.com/kidderminster/bodenham2008.xcl
>
>However, when I now try to download:
>
>   http://www.westmidlandbirdclub.com/kidderminster/bodenham2008
>
>my browser tries to open the .csv file.
>
>How can I fix that?


Rename the files?

Failing that, if there isn't a rewrite rule in .htaccess, you'll have
to speak to Gradwell.

Oh, hi Andy, long time no see. :)
date: Thu, 02 Jul 2009 00:38:36 +0100   author:   Geoff Berrow

Re: URL confusion   
On Wed, 1 Jul 2009 20:58:30 +0100, Andy Mabbett
 wrote in
<7j6L18nm$7SKFwWT@pigsonthewing.org.uk>:

>Some time ago, I configured the server I use so that the HTML pages
>like:
>
>   http://www.westmidlandbirdclub.com/kidderminster/bodenham2008.htm
>
>could be accessed using URLs in the format
>
>   http://www.westmidlandbirdclub.com/kidderminster/bodenham2008
>
>in the meantime I've forgotten how & where I did that - it might even be
>that my hosts, Gradwell, did it for me - there's nothing related, in my
>.htaccess file

If the server is Apache then perhps you are using "Content Negotiation":
<http://httpd.apache.org/docs/2.0/content-negotiation.html> and in
particular 'Multiviews'.

This looks to me like one of those area that gets really difficult if
you do not have complete control of the server configration and an
expert level understanding of what headers browsers send.

-- 
Owen Rees
[one of] my preferred email address[es] and more stuff can be
found at <http://www.users.waitrose.com/~owenrees/index.html>
date: Thu, 02 Jul 2009 01:12:47 +0100   author:   Owen Rees

Re: URL confusion   
On Wed, 1 Jul 2009 20:58:30 +0100, Andy Mabbett put finger to keyboard
and typed:

>
>
>Some time ago, I configured the server I use so that the HTML pages
>like:
>
>   http://www.westmidlandbirdclub.com/kidderminster/bodenham2008.htm
>
>could be accessed using URLs in the format
>
>   http://www.westmidlandbirdclub.com/kidderminster/bodenham2008
>
>in the meantime I've forgotten how & where I did that - it might even be
>that my hosts, Gradwell, did it for me - there's nothing related, in my
>.htaccess file
>
>I now have some files at:
>
>   http://www.westmidlandbirdclub.com/kidderminster/bodenham2008.csv
>   http://www.westmidlandbirdclub.com/kidderminster/bodenham2008.xcl
>
>However, when I now try to download:
>
>   http://www.westmidlandbirdclub.com/kidderminster/bodenham2008
>
>my browser tries to open the .csv file.
>
>How can I fix that?

You appear to be using content negotiation, which may well be enabled
by default (it often is). That's a simple way of getting the effect
that you describe, but it can have unexpected results. In particular,
to the server, .htm and .csv are both text files - the browser will
render them differently, but their actual contents are text. So,
unless explicitly instructed otherwise, when asked for a text file of
a certain name with no extension, it will pick the first. And that,
alphapbetically, is the .csv file.

One possible solution is to call your HTML files .html rather than
.htm. The latter is a Microsoftism that's a hangover from the days
when Windows 3.x couldn't cope with extensions longer than three
characters, and the chances are the the server isn't configured to
treat them specifically as HTML - it's probably just any other random
TLA extension as far as the server is concerned. But the server
probably is configured to recognise .html specifically as an HTML
file, and hence serve that in preference to a similarly-named text
file when the browser asks for a file without the extension.

Mark
-- 
Blog: http://mark.goodge.co.uk
Stuff: http://www.good-stuff.co.uk
date: Thu, 02 Jul 2009 07:03:33 +0100   author:   Mark Goodge

Re: URL confusion   
On Thu, 02 Jul 2009 07:03:33 +0100, Mark Goodge
 wrote:

>You appear to be using content negotiation, which may well be enabled
>by default (it often is). That's a simple way of getting the effect
>that you describe, but it can have unexpected results. In particular,
>to the server, .htm and .csv are both text files - the browser will
>render them differently, but their actual contents are text. So,
>unless explicitly instructed otherwise, when asked for a text file of
>a certain name with no extension, it will pick the first. And that,
>alphapbetically, is the .csv file.


Would  a .htaccess rewrite rule e.g.

RewriteRule ^bodenham2008$ bodenham2008.htm

override that?
date: Thu, 02 Jul 2009 09:38:28 +0100   author:   Geoff Berrow

Re: URL confusion   
On Wed, 1 Jul 2009, Andy Mabbett wrote:

> Some time ago, I configured the server I use so that the HTML pages
> like:
>    http://www.westmidlandbirdclub.com/kidderminster/bodenham2008.htm
> could be accessed using URLs in the format
>    http://www.westmidlandbirdclub.com/kidderminster/bodenham2008

  Options  +Multiviews

> I now have some files at:
>    http://www.westmidlandbirdclub.com/kidderminster/bodenham2008.csv
>    http://www.westmidlandbirdclub.com/kidderminster/bodenham2008.xcl
> However, when I now try to download:
>    http://www.westmidlandbirdclub.com/kidderminster/bodenham2008
> my browser tries to open the .csv file.

  AddType  text/csv;qs=0.8  csv
  AddType  text/xml;qs=0.9  xcl

I don't know what you actually mean by ".csv" and ".xcl".
You should put the correct MIME type where I just wrote text/csv
and text/xml.

-- 
In memoriam Alan J. Flavell
http://groups.google.co.uk/groups/search?q=author:Alan.J.Flavell
date: Thu, 2 Jul 2009 16:07:39 +0200   author:   Andreas Prilop

Re: URL confusion   
On Thu, 02 Jul 2009 09:38:28 +0100, Geoff Berrow put finger to
keyboard and typed:

>On Thu, 02 Jul 2009 07:03:33 +0100, Mark Goodge
> wrote:
>
>>You appear to be using content negotiation, which may well be enabled
>>by default (it often is). That's a simple way of getting the effect
>>that you describe, but it can have unexpected results. In particular,
>>to the server, .htm and .csv are both text files - the browser will
>>render them differently, but their actual contents are text. So,
>>unless explicitly instructed otherwise, when asked for a text file of
>>a certain name with no extension, it will pick the first. And that,
>>alphapbetically, is the .csv file.
>
>
>Would  a .htaccess rewrite rule e.g.
>
>RewriteRule ^bodenham2008$ bodenham2008.htm
>
>override that?

Probably, yes. But that's a bit of a kludge.

Mark
-- 
Blog: http://mark.goodge.co.uk
Stuff: http://www.good-stuff.co.uk
date: Thu, 02 Jul 2009 21:30:07 +0100   author:   Mark Goodge

Google
 
Web myreader.co.uk


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us