Welcome to WebmasterWorld Guest from 54.224.17.208

Forum Moderators: open

Message Too Old, No Replies

Opera, Options +MultiViews and name anchors

     
11:19 am on Nov 14, 2005 (gmt 0)

10+ Year Member



I'm using content negotiation (htaccess Options +MultiViews) to remove specific file extensions from URLs. This works very well as far as I can tell, however it causes me a minor problem with name anchors within a page.

Let say I have linked to www.example.com/page which is what will be displayed in the visitors address bar.

The actual page is www.example.com/page.htm.

This page includes get data, so lets assume the visitor is on the page www.example.com/page?widget=green

If I put a link on the page such as <a href="#top">Back to top</a>, IE and mozilla will both interpret the link as pointing to www.example.com/page?widget=green#top. However Opera will link to www.example.com/page.htm#top.

I believe this is because of the http header "Content-Location: page.htm" that will be returned with the page request.

I can overcome this behaviour by linking instead to REQUEST_URI#top however I have a couple of questions:

Is Opera's behaviour correct? While the browser is informed of the actual content location, the page does return a 200, so should the original URL not be used? Why would Opera also remove query strings from the link?

Should I give up on multiviews and try to use mod_rewrite instead?

11:45 am on Nov 14, 2005 (gmt 0)

10+ Year Member



Well it seems Opera's interpretation is the correct one:

The Content-Location entity-header field MAY be used to supply the resource location for the entity enclosed in the message when that entity is accessible from a location separate from the requested resource's URI. A server SHOULD provide a Content-Location for the variant corresponding to the response entity; especially in the case where a resource has multiple entities associated with it, and those entities actually have separate locations by which they might be individually accessed, the server SHOULD provide a Content-Location for the particular variant which is returned.

Content-Location = "Content-Location" ":"
( absoluteURI relativeURI )

The value of Content-Location also defines the base URI for the entity.
[w3.org...]

 

Featured Threads

Hot Threads This Week

Hot Threads This Month