Strange Strands

24 Mar 2006

Counterparts to Fame the Wit

Two crazy ideas. The first is having a directory on inamidst in which to keep my dotfiles, i.e. my unix program configuration files. The idea is then that they'll be kept in the revision control system I use for inamidst, so I'd have versions of them and distributed backups—I try to keep as much of my work on inamidst as is feasible. But the filesystem paths, e.g. ~/.ssh/conf for the ssh dotfile, are quite messy; I'd rather that example be served as /sshconf were it to be a URI. So clearly some kind of mapping has to take place.

At first I just copied from the neat addresses under DOCUMENT_ROOT to the messy addresses in my HOME directory, but this meant that I had to use cp -p on every file, and hence there was a lot of data transfer and messy updating when there was no need. So instead I decided to make the addresses in the DOCUMENT_ROOT be absolute mirrors of HOME so that then I could use rsync to copy the files over. But that meant that I'd have to do the mapping on the server, in an .htaccess file. So what I want is for the following to happen:

  • GET /directory/.emacs → 301 (Location: /directory/emacs)
  • GET /directory/emacs → 200 OK (returns .emacs file)

You can see the obvious potential for an infinite loop there. But I thought I'd be able to get around that using the following mod_rewrite rules in Apache:

RewriteRule ^emacs$ .emacs [L]
RewriteCond %{REQUEST_URI} \.emacs$
RewriteRule ^\.emacs$ /directory/emacs [R]

Indeed I've confirmed that the REQUEST_URI is different for each rule, but still this combination refuses to work for some reason. The correct value, i.e. the final environment variable value, of REQUEST_URI is for some reason not being passed to the RewriteCond. So one fallback idea that I've had is to have a separate folder for the files, in a robots.txt protected directory, and then make the public directory write onto that. Since with that method I won't have to set up redirects from the private directory, there won't be a loop.

The second idea is of selecting Strange Strands posts to be copied to miscoranda. In other words, miscoranda would be an anthology on-the-fly of Strange Strands. But that would mean redundant posts unless I redirected the selected Strands posts to their miscoranda counterparts.

Strange Strands, Counterparts to Fame the Wit, by Sean B. Palmer
Archival URI: http://inamidst.com/strands/counterparts

Feedback?

Your email address:
inamidst.com