Sorry for the delayed reply... after I got it working I kinda just let it fall off the radar.
Thanks, first and foremost, for your help with this! I certainly don't mean to act like "give give give, fix fix fix, this is broken, omg omg"... I just forget to emphasize the things that
are working - that is, everything but what I've mentioned
The wiki is helpful in letting me locate the macros I need to use, and explaining how to use them (even if they're not each written in fully proper syntax, I can figure it out most of the time).
As a result of that, plus debug logging - which I put to some use in realizing that oh-crap, my PHP training had me using "{.if param|param|param.}", instead of "{.if|param|param|param.}" - I now have a working "sorting-and-redirection" event!
Behold, my first "hello world" script!
[request]
{.if|{.substring|F4UBCD||%url%.}|{:
{.redirect|http://server
.domain.com:281/F4UBCD45.}:}.}
{.if|{.substring|data||%url%.}|{:
{.redirect|http://domain.
com/viewfile.php?file={.cut|7||%url%.}.}:}.}
Yeah, I realize that first example isn't functionally proper, but when I did a full file-redirect to the new URL, the clients (BitTorrent "web seeds") were botching the URL, as I guess uTorrent has a broken redirect-handler... so when they were redirected from server.xyz/F4UBCD45/path/to/file.ext, to othersite.abc/F4UBCD45/path/to/file.ext (spent a while debugging this with tinyget to read the returned headers), they would
actually request the non-existent file from HFS: othersite.abc/F4UBCD45/path/to/file.ext/path/to/file.ext. Seems that it uses the redirect as the new "seed root" and appends the file name no matter what... and since I couldn't find a way to filter against User-Agent (BtWebClient/xxyy being the trouble one), and since it's not a "critical" file to be served (merely a convenience), I just broke the redirect as such.
The second filter is an odd one... for some reason, I seem to have users that are hard-linking to the redirected file path, outside the main Apache file-handler (which is now configured to use the port 281 server). So instead of just silently redirecting these trouble files, I figure I'd direct a little more traffic through the site instead... so if it catches a URL using the old data path, it'd strip off the URL and send them to
the "viewfile" page that provides a proper link through the Apache redirector. Strange that people would do that, since hits aren't logged outside the PHP redirection script, and if the hits aren't logged, the file is deleted for inactivity. Stupid people.