[pmwiki-users] 404 errors when following action link
David Annett
david at annett.co.nz
Sat Nov 22 02:25:41 PST 2025
Enabling path using:
$EnablePathInfo = 1;
fixed the problem for me.
Thanks for the prompt and helpful reply, it is appreciated :-)
On 22/11/25 23:13, Petko Yotov wrote:
> What happens if you open:
>
> pmwiki.php/Site/APage?action=edit
>
> If this works, the easiest is to enable path info in local/config.php:
>
> $EnablePathInfo = 1;
>
> If it doesn't, see if you can enable path info for Lighttpd and PHP -
> see documentation for your version.
>
> Apache allows a second '?' inside the query string and passes the
> entire tail to PmWiki, which parses it to set the correct variables.
>
> Lighttpd seems to stop at the first ? so PmWiki never receives the
> second segment.
>
> There are many places both in the PmWiki core, and recipes, that use
> the construct:
> {$PageUrl}?action=something
>
> This is for links and for posting forms.
>
> So we cannot quickly fix all these places, but if path info works,
> this may be enough for you.
>
> The other thing to try is to configure Lighttpd to url-rewrite (encode
> to %3F) the second question mark, something like this:
>
> url.rewrite-once = (
> "^/wiki/pmwiki.php(.*)\?(.*)\?(.*)$" => "/wiki/pmwiki.php$1?$2%3F$3"
> )
>
> Or replace it with &:
>
> url.rewrite-once = (
> "^/wiki/pmwiki.php(.*)\?(.*)\?(.*)$" => "/wiki/pmwiki.php$1?$2&$3"
> )
>
> Url rewriting "mod_rewrite" needs to be activated, probably under
> server.modules.
>
> This is in a Lighttpd server configuration file, maybe
> /etc/lighttpd2/lighttpd.conf.
>
> I searched the mailing list for Lighttpd, this seems to be the only
> report for this problem in the last 10 years. I am willing to get
> PmWiki to work out of the box on Lighttpd.
>
> Petko
>
> On 22/11/2025 10:22, David Annett wrote:
>> I have made progress, the query parts have the wrong separator. On
>> the page:
>> http://example.com/wiki/pmwiki.php?n=Site.APage
>> the edit URL provided is:
>> http://example.com/wiki/pmwiki.php?n=Site.APage?action=edit
>> when it should be:
>> http://example.com/wiki/pmwiki.php?n=Site.APage&action=edit
>>
>> Not sure if this is PMWiki issue or a Lighttpd issue but I am guessing
>> this is something I can configure Lighttpd to deal with, but it would
>> be better if the rendered page had the correct URL.
More information about the pmwiki-users
mailing list