According to this line from Apache access log, it seems like Opera sometimes includes the hash fragment in the URI sent to server:

[26/Apr/2011:01:09:03 +0200] "GET /dagbok/#type=food HTTP/1.1" 500 - "-" "Opera/9.80 (Windows NT 6.1; U; nb) Presto/2.8.131 Version/11.10"

Any experience or insights on why it's doing that?

The URI should be trapped by jQuery's hash change event which in turn triggers .load() on the URI /dagbok/food/.

PS! The 500 Internal Server occurs because the routing doesn't understand URIs with a hash-fragment in it. Neither should it.

Update with RewriteRules:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule !.(js|ico|txt|gif|jpg|png|css)$ index.php

Index.php then starts Zends front controller/router which is unable to find any route for this URI. Which is correct since this URI never should reach the server.


What version of Opera are you seeing this in?

Written by Roatin Marth

Can you post some details about the server, the log looks strange as the server should ignore the fragment. Do you use some rewrite_rules?

Written by Dr.Molle

@Roatin Marth As the log says it's Opera 11.10. Also saw it with 11.01, but noone uses that anymore.

@Dr.Molle Running with a basic RewriteRule which sends "everything" to index.php where Zends front controller/router parses the request URI. There it fails hard since it does not find a route for this URI. Added the RewriteRule to the original question.

Look at these links, is there any differences between them? [1]:… [2]:… The url shown at status bar is same, but the first one includes %23 instead of '#'

Written by Taha Jahangir

Accepted Answer

I guess jQuery doesn't remove the #hash part from the URL before sending an XMLHttpRequest, and relies on the browser doing so. A quick test shows Opera doesn't. (This should probably be considered a bug in Opera - I don't think there is any standard covering this exact point but it's not doing what most others probably do.)

Written by hallvors
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the community.
It is licensed under cc-wiki