Results 1 to 2 of 2
Thread: HTTP 300 Redirection
Mar 28, 2008, 09:40 #1
- Join Date
- Feb 2007
- 0 Post(s)
- 0 Thread(s)
HTTP 300 Redirection
I'm having some trouble with HTTP 300 redirection, particularly in how Opera chooses to handle it. I'm not sure if this is the right forum for this problem, but it seemed like the best choice; if not, please forgive my ignorance.
My site is multilingual, and will need to be able to deliver linguistically appropriate content to users who haven't yet explicitly specified which language they prefer.
For instance, a request for the (relative) URL "/pages/view/id/home" will need to be redirected (based on the language preferences provided by the browser) to something like "/pages/view/id/home/lang/en_US" or "/pages/view/id/home/lang/fr". (BTW, these are Zend Framework URLs; I may change them later to make them shorter.)
As I understand it, this kind of redirection should be handled via an HTTP 300 status header. So...if the user requests "/pages/view/id/home" and his or her "Accept-Language" settings indicate that he or she likes U.S. English pages, we send the following response:
(roughly, these are the headers...I realize they may not look exactly like this, but this should give the right idea.)
Status: HTTP/1.1 300 Multiple Choices Location: http://www.website.fake/pages/view/id/home/lang/en_US
<html> <head>...</head> <body> <h1>Please Choose a Language</h1> <ul> <li><a href="/pages/view/id/home/lang/en_US">U.S. English</a></li> <li><a href="/pages/view/id/home/lang/fr">French</a></li> <li><a href="/pages/view/id/home/lang/de">German</a></li> </ul> </body> </html>
Firefox and IE both implement automatic redirection in this situation; Opera, however, does not seem to do so. While this is technically allowable according to the spec, it's pretty inconvenient, especially if my pages (and more importantly, printed promotional materials) include a lot of language-agnostic links. Users will get pretty tired of seeing that language chooser.
So, my question in a nutshell...is there something I can do differently with my HTTP headers to make sure that Opera DOES automatically redirect for HTTP 300s with Locations? Or am I stuck with the default?
Or am I missing something obvious?
Thanks for any help you can offer!
Mar 29, 2008, 21:19 #2
- Join Date
- Feb 2002
- 19 Post(s)
- 2 Thread(s)
Check apache.org for mod_negotiation - that's supposed to do the job automatically (based on the request from the browser).