This turned out to be quite simple, but I wanted to post a solution for the
record...
There is a useful function called Redirect() in PmWiki's core functions. To
use it, just call Redirect($pagename).

For example... In a group.php config file I can include:

$ref = $_SERVER["HTTP_REFERER"];
$pattern = '/collection=([^\&]*).*item=([^\&]*)/';
if (preg_match($pattern,$ref,$matches)) {
$collection = $matches[1];
$item = $matches[2];
Redirect(MakePageName("","Discuss.$collection$item"));
}
Redirect("Discuss.Sorry");

...Eric

On 11/21/07, Eric Celeste <[EMAIL PROTECTED]> wrote:
>
> I'd like to have PmWiki choose which page to show based on the referrer to
> PmWiki without depending on external rewriting of the addresses involved.
> For example:
>
>
>     ... if my wiki is "http://target.com/pmwiki.php";,
>
>
>     ... a link on " http://source.com/foo"; to "
> http://target.com/pmwiki.php?n=Bob";
>         would end up retrieving "Bob/foo"
>
>     but
>
>
>     ... a link on "http://source.com/bar"; to 
> "http://target.com/pmwiki.php?n=Bob
> "
>         would end up retrieving "Bob/bar"
>
>
> I know how to get and parse the referrer in PHP, but I am not clear on how
> to get PmWiki to redirect its efforts toward showing a page other than the
> one it was called to show.
>
>
> Any quick hints as to how to go about this in the Bob.php group config
> page?
>
>
> Thanks,
> ...Eric
>
>
>
_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to