Subdirectories: NewFeatures.
2005-06-01
Page Names That DWiki Won't Serve
There are some paths and page names that DWiki categorically refuses to serve, even if they seem to resolve to real files. Because they're enforced by both low-level code and high-level code, they apply to DWiki pages, static files being served by DWiki, and even templates. (Technically they apply to comments too, but comments can't generate file names that violate these rules.)
What gets rejected:
Any path that includes a path component that starts with a
., ends with,vor a~, or isRCS.Any non-relative path that includes
..,., or a sequence//; usually this might appear in the URL of an incoming request. (Incoming requests are not supposed to include things like that. But ChrisSiebenmann declines to believe that everyone sending DWiki requests is going to do what they're supposed to.)DWiki will reject REDIRECT files that either have too many '..' entries (so that they are trying to escape the root of the page directory) or that fail these checks after they've potentially been converted from relative path names to absolute inside-DWiki paths.
When DWiki rejects bad paths, generally it says that there is no page by that name. Sometimes it rejects the request entirely in huge flames.
Redirection Files
Files in the page directory can create HTTP redirections, making it trivial to support plurals, moved/renamed pages, and so on. There are two ways of doing it:
REDIRECTcontent and symbolic links.If a file starts with a line that says '
REDIRECT somewhere', and does not have more than a few lines of content, DWiki considers it a redirection. The somewhere is basically interpreted as if it was appearing in a[[....]], so it can be:
- redirection to another DWiki page.
- redirection to an external web site, written as
http://....- redirection to an absolute URL on this web site, written as
<...>These files are generically called REDIRECT files.
A symbolic link is only considered a redirect if DWiki can 'resolve' it into an existing page. To resolve the symbolic link redirect, DWiki tries to interpret the symbolic link's value as if it was appearing in a
[[...]]as a DWiki relative page name.If the symbolic link doesn't resolve this way, DWiki treats the whole thing as an ordinary page; this keeps 'ordinary' uses of symlinks intact in most cases, including when the symlinks point to something outside the DWiki page directory.
Redirects to http:// links or absolute URL links are a convenient way of creating WikiWord abbreviations to external things for local use. Make an appropriate REDIRECT file, stick it in your Aliases area, and now every page in the DWiki can say GoogleSearch or something and get a link, bam.
(WikiWord redirection rewriting means that in many cases the generated link will even point to the real target instead of the REDIRECT file, as you can see here.)
A DWiki RedirectFile can now point to absolute URLs as well
as local DWiki pages. Absolute URLs are written like they would be in
[[...]]; either http:// or <...>.
DWiki now supports generating links to URLs on the wiki's web server
that are outside the DWiki itself. These are written as links in the
format <...> and have to happen inside [[...]]. For example:
See [[the root of this web server|</>]].
generates a link to the DWiki's web server's root, which is all but certain to be outside the DWiki space if you're running DWiki as a CGI-BIN.
DWiki now remembers the name and URL for links that you write with
[[...|...]] and thereafter allows you to omit one side of the |,
at which point it will fill in the remembered values. This means that
if you want to link to Google a lot in your
document, you only have to write (eg) the URL once, and can thereafter
refer to Google much more compactly.
This does collide a little bit with using [[...|]] to write totally
unstyled text: it only comes out unstyled if it's not already been
used as the name of a link.
For now I will live with that.
The RecentChanges DWikiText macro now accepts additional arguments
that are the list of directories to restrict the listing to, or with a
dash at the front, directories to exclude from the listing. If you
combine both, both criteria must match: in an included directory and
not excluded.
This lets a RecentChanges listing exclude areas that churn too much or are otherwise less interesting to list. (Perhaps, for example, a blog sub-hierarchy in a DWiki.)
If there is a common directory prefix that scanning is limited to, the scan is efficient: only that directory and lower is looked at at all.