Deploying Firefox in the Enterprise: Part 5 (Revisited)

Since my original post on setting up a Firefox update server, I realized that some of my information was not correct. This post is to correct that information.

My mistake stemmed from the fact that the format of the Firefox update URL changed between Firefox 1.5 and Firefox 2.

Here’s the URL for Firefox 1.5:

https://aus2.mozilla.org/update/1/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/update.xml

Here’s the URL for Firefox 2:

https://aus2.mozilla.org/update/2/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/update.xml

You’ll notice two differences:

  1. The number after update was changed from 1 to 2 (this identifies which URL format to use)
  2. %OS_VERSION% was added to the URL

The important change here is the addition of OS_VERSION. Whereas before, the update URL provided information only about the browser, with OS_VERSION, the URL now contains information that changes based on the machine on which the browser is running. This makes providing updates a little trickier (although not that much).

(Incidentally, the reason that OS_VERSION was added was so that the update server could detect Windows98 and Windows95 and not send them updates that didn’t work on those machines.)

Let’s present a modified .htaccess file that handles this situation. I’m going to assume that in your enterprise deployment, you don’t care about OS_VERSION, so we are just going to ignore it. In our original .htaccess file, we simply checked for the existence of update.xml in a path that corresponded to the URL. Because of the addition of OS_VERSION, that won’t work anymore, since we would have to duplicate the update.xml file based on every possible OS_VERSION that could be sent to us. So we need to create a .htaccess file that ignores OS_VERSION. The way we do this, is simply redirect the URL to a new URL that doesn’t contain OS_VERSION, and then use our old method of checking for the existence of a file.

RewriteEngine on

RewriteRule ^(.*)/release/(.*)/update.xml /$1/release/update.xml [R]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) noupdate.xml

What this says is if the URL contains something between release and update.xml (OS_VERSION), remap it to remove the OS_VERSION. Then send it to the server again.

I’ll leave updating the PHP script as an exercise for the reader.

I hope this clears up any issues with my original post.

Please note: I reserve the right to delete comments that are offensive or off-topic.

Leave a Reply

Your email address will not be published. Required fields are marked *