Package: twiki
Version: 20030201-6
Severity: wishlist

I notice that the default apache config included with this version
includes a commented-out redirect directive for /twiki.  This line
doesn't work perfectly, because it supersedes the earlier Alias lines,
so the /pub and /data directories are inaccessible.  I changed the line
to a RedirectMatch which matches only subdirectory components beginning
with an initial capital, and this seems to work well.  The only caveat
is that this will only work so long as all your web names begin with an
initial capital.  I believe that this is the convention anyway, so it
should not be a great limitation, but probably still worth mentioning in
a comment in the file.

The advantage here is that it's now possible to use shortened URLs, for
example:

http://twiki/twiki/Main/TWikiUsers

Since apache serves a redirect to
http://twiki/cgi-bin/twiki/view/Main/TWikiUsers there shouldn't be any
issues relating to internal links; they will continue to use the long
form as always.

Please consider including this directive in the default apache.conf
fragment, at least as a commented example.



-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing'), (50, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.4.20-020stab009.24.777-enterprise
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages twiki depends on:
ii  apache2-common                2.0.52-3   Next generation, scalable, extenda
ii  debconf                       1.4.30.11  Debian configuration management sy
pn  libalgorithm-diff-perl                   Not found.
ii  libdigest-sha1-perl           2.10-1     NIST SHA-1 message digest algorith
ii  libnet-perl                   1:1.19-1   Implementation of Internet protoco
ii  perl [libmime-base64-perl]    5.8.4-3    Larry Wall's Practical Extraction 
ii  perl-modules [libnet-perl]    5.8.4-3    Core Perl modules
ii  rcs                           5.7-13.3   The GNU Revision Control System
--- apache.conf~        2005-02-02 00:35:31.000000000 -0800
+++ apache.conf 2005-02-02 11:24:52.000000000 -0800
@@ -1,8 +1,12 @@
 # Added for twiki
 Alias /twiki/pub /var/www/twiki/pub
 Alias /twiki/data /var/lib/twiki/data
-Redirect /twiki/index.html http://twiki/cgi-bin/twiki/view
-#Redirect /twiki/ http://twiki/cgi-bin/twiki/view
+
+#This RedirectMatch won't work for web names not starting with [A-Z]
+RedirectMatch /twiki(/[A-Z].*)?$ http://twiki/cgi-bin/twiki/view$1
+
+#Redirect /twiki/index.html http://twiki/cgi-bin/twiki/view
+#Redirect /twiki http://twiki/cgi-bin/twiki/view
 
 # make sure this is even needed, and ref the doc section needing it 
 <Directory /usr/lib/cgi-bin/twiki/> 

Reply via email to