[pmwiki-users] get rid of group Main from url
JB
jbit at bitlink.com
Thu Nov 9 17:19:04 CST 2006
I found a bug in my previous note.
It seems that PMWiki needs to have a "/" a the end of
the value of variable $ScriptUrl to edit a page.
I could browse but not edit.
To fix this I changed one line.
$ScriptUrl = dirname($ScriptUrl)."/";
The corrected code:
-----------------------------------------------------------------------------
# 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")';
-----------------------------------------------------------------------------
The code below is is incorrect.
* JB wrote, On 11/8/2006 2:23 PM:
> 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