[cl-wiki-devel] Living without *wiki-url*

Ian Clelland clelland at gmail.com
Wed Aug 31 23:32:17 UTC 2005


I've been working with Kevin Griffin on a couple of cl-wiki sites for
a few weks now, and I've found that, more often than not, the
*wiki-url* variable has been getting in my way.

The problem arises out of the way I am integrating cl-wiki with apache
-- I'm using proxy and rewrite rules to place a wiki in some directory
in a web site (not necessarily /cl-wiki/), and I don't want to have to
change that variable if I decide to move the wiki to a different
directory (which involves modifying the source code, and re-exporting
the lisp world).

However, since the '/' character does not seem to be allowed in wiki
names, the wiki is always a flat namespace, and so relative links will
work in all situations.

The only change needed to make this work is a redefinition of current-page to:

(defun current-page ()
  "Extracts the current page from the URL."
  (let ((url (tbnl:script-name))) (subseq url (+ 1 (position #\/ url
:from-end T)))))

and then the *wiki-url* prefix can be removed from all of the links in
wiki.lisp as well as the templates.

There's a working example up at http://research.cavewallarts.com/TOC2/
; I'll have a diff available soon.

Incidentally, the apache configuration I'm using in this case looks like this:

  <Proxy http://127.0.0.1:5757/>
    Order deny,allow
    Allow from all
  </Proxy>
  RewriteEngine On
  RewriteRule ^/TOC2$       /TOC2/       [R]
  RewriteRule ^/TOC2/$      /TOC2/Home   [R]
  RewriteRule ^/TOC2/(.*)   http://127.0.0.1:5757/cl-wiki/$1 [L,P]




Regards,

Ian Clelland
<ian at gmail.com>



More information about the Cl-wiki-devel mailing list