magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 1999 > 01 > Webmaster's Domain

Apache Rewriting

Recently I had to solve a classic problem in Web server administration: moving a large multipage document from an old server to a new server. In this case, the old server was an NCSA httpd site, and the new server was running Apache. The good news was that because the document had been designed with portability in mind, most of the hyperlinks and inline images used relative URLs. This meant that the links and images kept working even when the tree was moved from one directory structure to another. The bad news was that the document tree made extensive use of black-and-white X bitmap MIME-type icons (.xbm), maintained in the NCSA server /icons directory. For example, it used the tag <IMG SRC="/icons/movie.xbm"> whenever it linked to an animation file. Apache is backward compatible with NCSA httpd, even to the point of having its own /icons directory. However, nobody uses the old .xbm icons these days, and Apache replaced its MIME-type icons with colorful GIF icons a long time ago. As a result, everywhere the document referred to an .xbm file, the browser displayed a broken picture icon instead.

At this point I had several options open. One option was to write a Perl script to go through the document tree and change all instances of "something.xbm" to "something.gif". With the UNIX find program or the Perl find2perl script, this solution would be trivial. However, this approach involved changing the documents' HTML source code, and since I wasn't the author I felt uncomfortable doing this.<>




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2