[pmwiki-users] Can redirect send 301?

Joachim Durchholz jo at durchholz.org
Wed Jun 28 04:10:33 CDT 2006


Ryan R. Varick schrieb:
> Perhaps something as simple as a "silent" option would work?
> (:redirect NewPage status=301,silent:) or (:redirect NewPage
> status=301 options=silent:), for example.  Or perhaps an option for
> local customization?

Um... maybe "silent=yes".

This gives me these variations:

   (:redirect NewPage:)
   (:redirect NewPage status=temporary:)
   (:redirect NewPage silent=yes:)
   (:redirect NewPage status=temporary silent=yes:)

as shorthands for these directives:

   (:redirect NewPage status=permanent silent=no:)
   (:redirect NewPage status=temporary silent=no:)
   (:redirect NewPage status=permanent silent=yes:)
   (:redirect NewPage status=temporary silent=yes:)

PM's proposal is slightly different: specify the redirect message in the 
directive. In that case, I'd say that the message should simply be the 
remaining message body. E.g. the default would be

   (:redirect NewPage status=permanent:)
   Redirected from {$Pagename}

(I probably got the page variable name wrong).
The problem with that is that to suppress the redirect message, we'd 
have to write something like

   (:redirect NewPage:)[==]

to make sure that the default redirect message isn't printed.
Besides, the default would probably have to be localized, so it would 
have to be something like

   (:redirect NewPage status=permanent:)
   $[Redirected from {$Pagename}]

but now that would leak template syntax into PmWiki syntax.
Well, actually this might be a good idea. I think that substitutions 
should work the same, whether it's template or wiki syntax - I found it 
quite confusing to have different substitutions at different stages, and 
I tend to conflate page and template variables anyway. (I know that's 
nontrivial. Substitutions depend on context, contexts can already be 
nested in PmWiki (think multiple nested includes), and the bookkeeping 
to achieve that needs to be both ultra-correct and rather smart. I've 
been itching to provide something like that for months now, but other 
things - mostly getting paid-for work done - have been keeping me from 
doing that.)

Just my 2c.

Regards,
Jo




More information about the pmwiki-users mailing list