[pmwiki-users] Conditional external redirect

kirpi at kirpi.it kirpi at kirpi.it
Thu Dec 15 17:15:40 CST 2011


I'm in the process of rebuilding a small (read only) wiki.
In order to keep things simple, and provided that it is not a problem
to show a temporary
  <h2>We'll be back in a week or so…</h2>
page, I thought that I could place
  (:if ! auth edit:)
  (:redirect http://example.com/we_ll_be_back_soon.html status=307:)
  (:ifend:)
in all the 30 wiki pages which are now online (it would take a just
five minutes).
This way:
- all people will be shown the temporary page
- links are not broken, but properly redirected (for people and search
engines as well)
- the whole wiki remains available to me, just as normal, as I browse
it as a logged-in user (entering with ?action=login)
- once the whole rebuilding will be over, I can place a simple
(:redirect New.Page status=301 quiet=1:) on every old page in order to
tell anyone (and search engines) that the page has moved permanently.

As far as I can tell, (:redirect:) does not allow anything but wiki
pages to be targeted. And nothing external, anyway. This is due to
safety concerns.
I also found a thread [1] where Petko suggested an interesting
(:extredirect:) custom markup.
Yet, as I copied and pasted it into my config.php file, all I got was an error:
  Parse error: syntax error, unexpected '.' in
/web/htdocs/www.example.com/home/w/local/config.php on line 309

I was please curious to know:
- if such an approach makes sense ;-)
- if this (:extredirect:) markup could still be enabled
- if (:extredirect:) can be used in conditional redirects the same way
(:redirect:) can
- if, due to the fact that times have changed (not for the good,
necessarily) and most wikis are now closed for edits, it could maybe
be the case to let admins enable standard (:redirect:) markup for
external urls via a couple of variables, say
  - $EnableRedirect… to allow redirect to non wiki pages on the same domain
  - $EnableRedirect… to allow redirect to any page, anywhere
Or maybe better just $EnableRedirectExternal with 0, 1, 2 as
parameters with the same goals.
This would be in the hand of admins, of course, not writers, and I do
not see any severe threat as long as it is used with due care.

Thank you

Luigi

----
[1] http://www.mail-archive.com/pmwiki-users@pmichaud.com/msg18811.html



More information about the pmwiki-users mailing list