I hadn’t logged into the panel of one of my sites since the beginning of the summer, and today I can no longer open the site’s child pages. Sometimes, I can’t even open the homepage.
Maybe the problem is that my server (o2switch) seems to systematically transform URLs such as
/.../pages/films+chrysotile
into
/.../pages/films%2Bchrysotile
The page then returns:
“The page ‘films%2Bchrysotile’ could not be found.”
The response headers indicate, among other things:
The “+” character is one of the characters that should not be used in URLs. More specifically, the only characters allowed to ensure that URLs are read without alteration are lowercase letters, numbers, dots, hyphens, and underscores.
You should modify the software configuration so that it generates URLs such as .../pages/films-chrysotile in order to avoid this issue.
What would you recommend I do? Should I change hosting providers, or should I modify a Kirby file?
Sorry if this question has already been answered on the forum. I searched for a solution but couldn’t find one…
They confirmed that the issue isn’t related to the + character or the hyphen.
The pages are simply returning a 404 error. They also checked the relevant directories and confirmed that the permissions are correct, but couldn’t find anything that would explain the issue, apart from another directory with a hashed name.
I’m not really sure where to start troubleshooting this…
Not sure about this, but you could try something. It looks like your server turns the + in the URL into %2B, and Kirby doesn’t recognize that. It might be the rewrite rule.
Could you change this line in your .htaccess:
RewriteRule ^(.*) index.php [L]
to this:
RewriteRule ^(.*) index.php [L,NE]
The NE flag stops the server from encoding the URL again. Maybe the + stays as it is.
@kirby-team I think the server turns the + in the URL into %2B. Kirby doesn’t decode it back, so it says the page can’t be found.
From what I can see, Find::page() only replaces + and spaces with /, %2B isn’t handled at all. I tried it quickly, films+chrysotile works but films%2Bchrysotile gives a 404. Same in v5.
I think we need some normalization in the core. What do you think?
Thanks for your help, Ahmet.
It looks like rewriting the RewriteRule doesn’t solve the problem. The + in the URL is still being replaced with %2B. I’m getting the same error message, and the panel’s homepage still eventually displays a JSON file.
index.min.js:1 GET https://***.eu/***/pages/films+les-bedouins 404 (Not Found)
Ga @ index.min.js:1
request @ index.min.js:1
get @ index.min.js:1
open @ index.min.js:1
load @ index.min.js:1
open @ index.min.js:1
onClick @ index.min.js:1
_n @ vue.min.js:11
r @ vue.min.js:11
(anonymous) @ vue.min.js:11
index.min.js:1 Va: The request to https://***/***/pages/films+les-bedouins failed
at Xa (index.min.js:1:370332)
at async Ga (index.min.js:1:369915)
at async Object.get (index.min.js:1:392963)
at async Object.open (index.min.js:1:393120)
at async Object.load (index.min.js:1:374788)
error @ index.min.js:1
open @ index.min.js:1
await in open
load @ index.min.js:1
open @ index.min.js:1
onClick @ index.min.js:1
_n @ vue.min.js:11
r @ vue.min.js:11
(anonymous) @ vue.min.js:11
The JSON looks like it comes from the LiteSpeed cache. Maybe you can try turning it off for the domain in cPanel and see if it changes anything. Here is the o2switch guide, just do the reverse: Activer LiteSpeed Cache chez o2switch : le guide simple
We are looking into a fix in the core for the %2B part.