[pmwiki-users] get rid of group Main from url

JB jbit at bitlink.com
Wed Nov 8 14:23:49 CST 2006


Here is what works in my farmconfig.php so I can do this
farm-wide without putting anything into any of my
several local config.php files.

The differences are 1) using the PHP dirname() function
to strip the filename from $ScriptUrl, 2) I did not need
to set $PubDirUrl, 3) code is in my farmconfig.php.

-----------------------------------------------------------------------------
# Eliminate "index.php" & "pmwiki.php" from URLs.
# and get rid of ".Main"

$EnablePathInfo = 0;

$ScriptUrl = dirname($ScriptUrl);

# found I did not need to set this
#$PubDirUrl = 'http://gnuzoo.org/guitarstuff/pub/';

# the rest of the lines get rid of ".Main"
$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);

     $FmtPV['$PageUrl'] = 'PUE(($group==$GLOBALS["DefaultGroup"])
                                  ? "$ScriptUrl?n=$name"
                                    : "$ScriptUrl?n=$group.$name")';
-----------------------------------------------------------------------------





More information about the pmwiki-users mailing list