[pmwiki-users] Get rid of "Main"? (CleanUrls)

Patrick R. Michaud pmichaud at pobox.com
Wed Sep 27 09:36:16 CDT 2006


On Wed, Sep 27, 2006 at 04:26:06PM +0200, Mike wrote:
> Works like a charm, at least for the moment (after not too much
> testing). I'm quite happy, having now both CleanUrls and GetRidOfMain :-)
> 
> I'll post your advice as a cookbook recipe, if there's nothing speaking
> against it...

That would be fantastic, thanks!  (The recipe will simplify
slightly in an upcoming release, but we can update it then.)

Pm



> Patrick R. Michaud wrote on 26.09.2006 18:14:
> > On Tue, Sep 26, 2006 at 04:31:41PM +0200, Mike wrote:
> >>> I think it can be done, 
> >> Good news...
> >>
> >>> it just requires some tricky-ish configuration
> >>> of PmWiki (and possibly the webserver).
> >> ...less good news, as I could become a typical example of PEBKAC, unless
> >> there's some idiot-proof instructions somewhere...
> > 
> > I *think* the following will work in config.php:
> > 
> >     ##  add default group (Main) to page search path
> >     $PagePathFmt = array(
> >       '{$Group}.$1',           # page in current group
> >       '{$DefaultGroup}.$1',    # page in default group (Main)
> >       '$1.$1',                 # group home page
> >       '$1.{$DefaultName}',     # group home page
> >     );
> > 
> >     $pagename = MakePageName('Main.HomePage', $pagename);
> > 
> >     ## reformat page urls to omit default group (Main)
> >     $EnablePathInfo = 1;
> >     $FmtPV['$PageUrl'] = 'PUE(($group==$GLOBALS["DefaultGroup"])
> >                             ? "$ScriptUrl/$name"
> >                               : "$ScriptUrl/$group/$name")';
> >     $FmtP["!\\\$ScriptUrl/$DefaultGroup/!"] = '$ScriptUrl/';
> > 
> > 
> > I have this running at http://www.pmichaud.com/sandbox/nomain/pmwiki.php .
> > But it wouldn't surprise me if I've overlooked something somewhere,
> > so it would need some testing.
> > 
> > Pm
> > 
> 




More information about the pmwiki-users mailing list