mod_urlfile 1.0 05 Jan 2000 Donald King ================================= This software is Copyright (C) 2000 by Donald L. King. However, it may be distributed and modified freely, provided that my name remains attached to any programs or products derived from it. Files included in distribution ------------------------------ README - This file Makefile - Slightly altered "apxs -g" makefile mod_urlfile.c - The module code Brief Description ----------------- mod_urlfile is a quickie Apache module which intercepts the handler "url-shortcut" and reinterprets properly-formatted Win95-style .URL shortcuts as "302 Moved Temporarily" redirects. If it encounters a file which does not strictly conform to the .URL spec, it declines to handle it. What this means is that you can create a file called, for instance, "Yahoo.url" which will automatically redirect web browsers to the Yahoo! web site. In fact, the contents of the file are pretty simple: [InternetShortcut] URL=http://www.yahoo.com/ You can put whatever else you want into the file (provided it matches the Win95-style INI file format), as long as there is a "URL=" line under the heading "[InternetShortcut]". Installation ------------ Note: I didn't do anything blatantly unportable, so this should *theoretically* work on anything from WinNT to an EBCDIC system. The installation instructions, however, are Unix-specific. Also, these instructions use apxs, which will generate a DSO. If you want to (or must) compile this module into the server, you're on your own. Step 1: Edit the Makefile. You'll need to change all instances of '/usr/local/apache' to the directory where you actually installed Apache. You may need to make some other tweaks, depending on your system. Step 2: Compile. Type "make all" from the directory where you untarred the source. Unless you're on a pre-Pentium dinosaur, it should all be over in less than a second. Step 3: Install and Activate the module. Type "make install". The makefile will copy the .so file, and ask apxs to add the "LoadModule" and "AddModule" statements to httpd.conf. Step 4: Make the module do something. Edit "conf/httpd.conf" from the Apache base directory. Tweak apxs's handiwork to taste, then add lines similar to the following: AddHandler url-shortcut .url AddIcon (LNK,/icons/link.gif) .url AddDescription "URL Redirection" .url Step 5: Restart Apache. Execute "bin/apachectl restart". Poof, you're done!