[pmwiki-users] 404 errors when following action link
Petko Yotov
5ko at 5ko.fr
Sat Nov 22 02:13:36 PST 2025
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.
>
> On 22/11/25 21:50, David Annett wrote:
>
>> I had $ScriptUrl commented out. Setting didn't help. I don't have
>> CleanURLs or $EnablePathInfo defined that I can see.
>>
>> However .htaccess is a good clue as I have used Lighttpd in the RPI
>> 5, instead of Apache I have used on the x64 implementation. I'm
>> going to look into that.
>>
>> On 22/11/25 17:40, Petko Yotov wrote:
>>
>>> There looks like a problem with the $ScriptUrl variable.
>>>
>>> It should point to the browser-reachable URL of your index.php or
>>> pmwiki.php file, for example:
>>>
>>> $ScriptUrl = 'https://www.example.com/wiki/index.php';
>>> $ScriptUrl = 'http://192.168.1.55/wiki/index.php';
>>>
>>> Or a path without the domain name or IP address:
>>> $ScriptUrl = '/wiki/index.php';
>>>
>>> Normally PmWiki should autodetect this and you wouldn't need to
>>> define it. I'd check if your local/config.php has a value that is
>>> wrong, or points to the old server URL.
>>>
>>> If you were using CleanURLs or $EnablePathInfo - see Cookbook -
>>> there may be additional configuration on the server to direct such
>>> requests to PmWiki. For Apache servers it is often a .htaccess
>>> file, and it may be a "hidden" file, in a file manager you may
>>> need to enable "Show hidden files" to see it. Check if you need to
>>> migrate this file too.
>>>
>>> Petko
>
> --
> ACCL_Sig
> David Annett
> Annett Computer Company
>
> Email:
> david at annett.co.nz
>
> Website:
> www.annett.co.nz [1]
>
> NZ mobile:
> +64 21 436 707
>
> USA mobile:
> +1 650 772 1412
>
> NZ address:
> 90 Muhunoa West Rd, Ohau, Manawatu 5570, New Zealand
>
> NZ shipping address:
> 2/6 Parker Ave, Levin 5510, New Zealand
>
> Signal:
> +64 21 436 707
>
> WeChat:
> DavidAnnett
>
>
>
> Links:
> ------
> [1] http://www.annett.co.nz
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
More information about the pmwiki-users
mailing list