[pmwiki-users] How to specify target page for search results?

Roman romat2 at gmail.com
Fri Jan 12 07:23:21 CST 2007


> Try the following in local/config.php (probably near the bottom):
>
>    if ($action == 'search') {
>      $pagename = ResolvePageName($pagename);
>      if ($pagename != 'Site.Search') {
>        $qs = preg_replace('/\\bn=[^&?]*/', '', @$_SERVER['QUERY_STRING']);
>        Redirect('Site.Search', "\$PageUrl?$qs");
>      }
>    }
>

Patrick, thank you for your help, that's what I was looking for. Just
a little question regarding URL

URL Before:
http://server/wiki/?n=CurrentGroup.CurrentPage&action=search&q=test

URL Now:
http://server/wiki/Site/Search?&action=search&q=test

Notice first ampresand following question mark. Can it cause any problem?

Roman




More information about the pmwiki-users mailing list