Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Opera, Options +MultiViews and name anchors

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

Preferred Member

10+ Year Member

joined:Apr 6, 2003
votes: 0

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)

Preferred Member

10+ Year Member

joined:Apr 6, 2003
votes: 0

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.


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members