?

Log in

No account? Create an account
Does anyone here have write access to a PHP web server? - Ron Newman [entries|archive|friends|userinfo]
Ron Newman

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Does anyone here have write access to a PHP web server? [Mar. 11th, 2011|08:57 pm]
Ron Newman
I am investigating an unfortunate interaction between a Facebook feature (the "always use https" preference) and the behavior of certain browsers (definitely Mac Safari, perhaps others) when they receive an HTTP "302" redirect.

To do this, I'd like to put a PHP file and a couple of HTML pages up on a web server, and then have a few people bang on the PHP page from various browsers on various operating systems. I'm especially interested in how Internet Explorer behaves, but I can't test this locally at home because I have only a Mac.

Can anyone help?

Specifically, I'm investigating the behavior of browsers when Facebook redirects a URL of the following format from http to https:

http://www.facebook.com/#!/YoungSomerville

On my Mac, Safari 5.0.3 responds to the redirect by going to https://www.facebook.com/ , while Firefox 3.6.15, Camino 2.0.6, Chrome 10.0.648.133, and Opera 11.01 all go to
https://www.facebook.com/#!/YoungSomerville .

The latter behavior seems much more useful, and presumably is what Facebook expects, but it's not clear to me whether any official standards require it. I'd like to know how Internet Explorer and other PC browsers (and Linux browsers, for that matter) behave.

So if you can take a few small files from me and put them on a public web server that can run PHP, I'd greatly appreciate it.
linkReply

Comments:
[User Picture]From: nosrednayduj
2011-03-12 03:27 am (UTC)
For others interested in helping, it's now up at http://www.olum.org/yduj/redir_frag. Have fun, and report your browser version and the results you got from the four tests. I did IE 8 and FF 3.6 on a PC and a really old FF 3.0 on linux. And lynx, just for grins.
(Reply) (Thread)
[User Picture]From: ron_newman
2011-03-12 03:36 am (UTC)
Thanks! The results I get on my Mac:

No old or new fragment: "" in all my browsers

Old fragment only: "" in Safari 5.04; "#old" in Firefox 3.6.15, Camino 2.0.6, Chrome 10.0.648.133, and Opera 11.01. I consider Safari's behavior to be broken.

New fragment only: "#new" in all my browsers

Both old and new fragments: "#old" in Opera, "#new" in Safari, Firefox, Camino, and Chrome. I wonder why Opera is choosing different behavior from the others.

(What results did you get from your tests, Judy?)

Edited at 2011-03-12 04:02 am (UTC)
(Reply) (Parent) (Thread)
[User Picture]From: nosrednayduj
2011-03-12 02:02 pm (UTC)
IE: "" "" "#new" "#new"
FF (both): "" "#old" "#new" "#new"
(Reply) (Parent) (Thread)
[User Picture]From: ron_newman
2011-03-12 07:10 pm (UTC)
Thanks. So IE also behaves (in my opinion) wrongly, and Safari may have just copied that behavior.

I don't know whether it is possible to run more than one version of IE on a PC. If you have other versions of IE around (9, 7, 6), can you try them as well?
(Reply) (Parent) (Thread)
[User Picture]From: nosrednayduj
2011-03-12 08:38 pm (UTC)
There's an ancient win2k machine at work with IE 6, and a somewhat oldish un-updated machine with IE7. Identical behavior ("", "", "#new", "#new") in both. Interestingly, in IE6, when I went "back" after doing the first one, the "old only" link was purple as well as the "no frag" link! But when I hovered, tooltips showed the text of the link different (with and without the #old). IE7 only purpled the links after I'd actually clicked on them individually. Can't remember what happened with IE8. Don't have IE9. Hoping to avoid it. Wasn't thrilled with the forced switch to IE8.
(Reply) (Parent) (Thread)
[User Picture]From: ron_newman
2011-03-12 08:45 pm (UTC)
Thank you so much, Judy. If you can leave my files up for a few more days, maybe I can find someone else to try it with IE9.

This appears to be a Python script running a self-contained little web server (no Apache needed) to test the same thing: https://gist.github.com/330963

Edited at 2011-03-12 08:46 pm (UTC)
(Reply) (Parent) (Thread)
[User Picture]From: nosrednayduj
2011-03-12 08:55 pm (UTC)
Yeah, sure, it's not like it's taking a lot of resources.

I don't get what I would do with the github test; put it directly in my html directory (where "/yduj" goes) as redir_frag.py? Or is there some html that needs to wrap it too? As you may have guessed, I'm kind of clue free about anything that isn't just writing <html>blah</html>. (OK, so I proved I know about ampersand lt there. But that's about the limit of my trickiness.)
(Reply) (Parent) (Thread)
[User Picture]From: ron_newman
2011-03-12 08:59 pm (UTC)
Don't worry about the Python unless you feel like it. You run it from the command line:

./redir_frag_test.py localhost port_number

and it runs its own little self-contained web server on that port. It requires that Python library, nbhttp , be installed, which is at http://github.com/mnot/nbhttp .
(Reply) (Parent) (Thread)
[User Picture]From: nosrednayduj
2011-03-12 09:03 pm (UTC)
OK. I'll pass on that, someone else can help you with that test...
(Reply) (Parent) (Thread)
[User Picture]From: ron_newman
2011-03-12 08:56 pm (UTC)
While Lynx has no knowledge of JavaScript and therefore can't display the fragment ID on the web page, its redirection behavior appears to be identical to Firefox and Chrome.
(Reply) (Parent) (Thread)