Earlier today (talkread.bml?itemid=22974104), I introduced a plan for assigning canonical URLs to new LJ documentation. Under this plan, a document which could be requested directly as
/doc/html/moodicons.htm
will normally be linked to (from outside the documentation system) using the less specific URL/doc/find?guide=moodicons
.
The redirection is performed by a simple CGI script which will later be enhanced to do various things like selecting from multiple document formats.I have no experience with IIS or servers other than Apache. To avoid future porting difficulties, it would be helpful if people familiar with IIS or other servers could comment on whether the plan I've described would be more difficult to implement on other servers.
The CGI script is running on my goathack server as cgi-bin/doc_find.pl and is supported by some general-purpose CGI code in cgi-bin/doc_CGI.pm.
View cgi-bin/doc_find.pl as text.
View cgi-bin/doc_CGI.pm as text.
There are a few FIXME lines in doc_find.pl, but they all refer to trapping obscure errors which are nearly always ignored in other CGI scripts.
To get these scripts working, I added the following directives to /etc/httpd.conf:
By the way, I'm pretty familiar with CGI but not with FastCGI / signal handling, so the FastCGI support I've provided is based mainly on what I found in existing files like 404notfound.cgi.FastCgiServer /home/tribelessnomad/cgi-bin/doc_find.pl -processes 1 -initial-env LJHOME=/home/tribelessnomad Alias /doc/find /home/tribelessnomad/cgi-bin/doc_find.pl <Directory /home/tribelessnomad/cgi-bin> <Files doc_find.pl> SetHandler fastcgi-script </Files> </Directory>
Anyone want to suggest improvements?