MSIE sucks (again)

pic by icanhazcheesburger

Over the recent months, the load on my server increased. One reason was that visitor numbers are increasing as well (yeah!). However in the last days the load climbed much higher than it was explainable by increased interest.

A top did show a high CPU usage by the MySQL database. But on my server the site with the most visitors by far is the wiki. And as we all know, there is no database used by DokuWiki. So my first guess was the forum.

My guess was right, as soon as I slayed the forum fastcgi backend the load went down 1).

The access log was showing requests for very strange URLs. I grepped for the IP of one user requesting such an URL, and this is what I saw:

[13/Jun/2008:20:26:49 +0200] "GET /thread/948 HTTP/1.1" 200 28425 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;1813)"
[13/Jun/2008:20:26:52 +0200] "GET /thread/948/unb_lib/common.js HTTP/1.1" 200 28425 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;1813)"
[13/Jun/2008:20:26:54 +0200] "GET /thread/948/unb_lib/unb_lib/common.js HTTP/1.1" 200 28425 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;1813)"
[13/Jun/2008:20:26:59 +0200] "GET /thread/948/unb_lib/unb_lib/unb_lib/common.js HTTP/1.1" 200 28425 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;1813)"
[13/Jun/2008:20:27:01 +0200] "GET /thread/948/unb_lib/unb_lib/unb_lib/unb_lib/common.js HTTP/1.1" 200 28425 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;1813)"
[13/Jun/2008:20:27:04 +0200] "GET /thread/948/unb_lib/unb_lib/unb_lib/unb_lib/unb_lib/common.js HTTP/1.1" 200 28425 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;1813)"
[13/Jun/2008:20:27:08 +0200] "GET /thread/948/unb_lib/unb_lib/unb_lib/unb_lib/unb_lib/unb_lib/common.js HTTP/1.1" 200 28425 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;1813)"

Looked like some infinite redirect going on, but why?

Digging through the page source the following code jumped at me:

<base href="http://forum.dokuwiki.org/" />
...
<script type="text/javascript" src="unb_lib/common.js"></script>

Could it be that Microsoft's Internet Explorer had trouble using the base href? A bit of googling confirmed it. MSIE ignores the tag for javascripts and requests the document from the wrong URL. Usually this would result in a 404 but URL rewritig at the server will just return the very same page again, which causes IE to load the script again, which will… well, you get the idea.

I fixed the problem by hacking the UNB sources to return an absolute path for the scripts. In line 251 of unb_lib/common.lib.php I simply prepended a slash:

//$UNB['LibraryURL'] = TrailingSlash(rc('lib_url'));
$UNB['LibraryURL'] = '/'.TrailingSlash(rc('lib_url')); //hard code basedir

There are three things we can learn from that:

  1. Developers should never rely on base href.
  2. Admins should always check the user agent first, when something is wrong.
  3. Users should already stop using Internet Explorer. Please?!
Tags:
msie,
dos,
basehref,
unb,
load
Similar posts:
1) sorry if you got a 500 during that time

 
Posted on Friday June the 13th, 2008 (5 months ago).

Comments

1
You're only having this problem with IE6, right?  IE7 significantly changed the <BASE> handling.
2008-06-28 01:48:55
Eric
CAPTCHA

No HTML allowed. URLs will be linked with nofollow attribute. Whitespace is preserved.

 
 

Blog

Older Weblog articles are available in the Archive, subscribe to the
Full Content RSS Feed
to stay tuned. (learn more)

Subscribe to the Feed

Recent Blog Entries

 

This is the personal web site of Andreas Gohr - human being, blogger and web geek from Berlin, Germany.

This page was last updated at 2008/06/13 21:56.
Imprint/Impressum

Tagged at del.icio.us:
No tags, yet. Why don't you bookmark it?

View blog reactions

Advertising:

Advertise Here
advertise here

Recent readers: