Page 1 of 1

Folders with underscore in show 404

Posted: 23 Sep 2018, 14:24
by temabu
Folders which have an underscore in the name will show 404 error even if there are pictures in the gallery.

Re: Folders with underscore in show 404

Posted: 24 Sep 2018, 04:05
by mjau-mjau
temabu wrote:Folders which have an underscore in the name will show 404 error even if there are pictures in the gallery.
Can't confirm. Here is a folder "has_underscore" on your website:
https://****/test/has_underscore/

The only occasion where _underscore may fail, is if combined with periods. For example "this_is.a.folder_name". Really, you should avoid BOTH those "special" characters in folder names anyway. Use -hyphens- to separate words: "nice-url-here".

Re: Folders with underscore in show 404

Posted: 25 Sep 2018, 17:21
by temabu
Not sure if this is wholly correct.  See folder I added an underscore to which then adopted underscores for all spaces (automatically).  However the visible name in the folder edit shows spaces, but the folder shown in URL includes underscores.  And we get a 404....
2018-09-25_231549.png
2018-09-25_231549.png (8.34 KiB) Viewed 5468 times
2018-09-25_231717.png
2018-09-25_231717.png (17.48 KiB) Viewed 5468 times
I edited the name and added a single underscore before "Horse".  Seems a bit wooky here...

Re: Folders with underscore in show 404

Posted: 25 Sep 2018, 17:25
by temabu
Renaming it and removing the underscore fixes the problem.

Re: Folders with underscore in show 404

Posted: 25 Sep 2018, 23:43
by mjau-mjau
I can see the problem was related to empty spaces. X3 does in fact support empty spaces in folder names, but not when combined with _underscores. The reason is that empty spaces are special characters that are routed in to PHP as _underscore. Thus, when the two are combined, it's impossible for X3 to anticipate the folder that the URL is trying to reference.

Although supported (when not combined with _underscore), including empty space character in folders from the X3 panel is disallowed. Empty spaces are counter-productive, because they create URL's with "%20" to replace the space.

Re: Folders with underscore in show 404

Posted: 24 Oct 2018, 20:24
by CrisC
then it would be good to disallow such kind of input directly within the panel (if not already implemented - I haven't tested this yet)

Re: Folders with underscore in show 404

Posted: 24 Oct 2018, 22:58
by mjau-mjau
X3 doesn't allow empty spaces when input from the panel.

Although it would work (when not combined with _underscore_), it's counter-productive. Space character creates ugly URL's, for example "my folder name" => /my%20folder%20name/.

Re: Folders with underscore in show 404

Posted: 25 Oct 2018, 02:51
by CrisC
yes, that's clear to me - but my question was more: why is it then possible to create / allow those inputs :)

Re: Folders with underscore in show 404

Posted: 25 Oct 2018, 05:13
by mjau-mjau
CrisC wrote:yes, that's clear to me - but my question was more: why is it then possible to create / allow those inputs :)
But it is NOT allowed from input:
Image

If you have SPACES in your folder names, it means they were not created by X3.

_Underscores ARE allowed because they are perfectly valid, also in URL's /url_with_underscore/. So even though X3 does TRY to support url's with spaces by converting to underscores, you will break if you have both underscore and empty spaces in your url's. So, just avoid empty spaces, as this is not even allowed from the X3 panel.

Re: Folders with underscore in show 404

Posted: 25 Oct 2018, 05:17
by CrisC
alright :) Misunderstood your previous post then :)