Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
temabu
Experienced
Topic Author
Posts: 29
Joined: 26 Sep 2008, 17:13

Folders with underscore in show 404

23 Sep 2018, 14:24

Folders which have an underscore in the name will show 404 error even if there are pictures in the gallery.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 11675
Joined: 30 Sep 2006, 03:37

Re: Folders with underscore in show 404

24 Sep 2018, 04:05

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".
 
User avatar
temabu
Experienced
Topic Author
Posts: 29
Joined: 26 Sep 2008, 17:13

Re: Folders with underscore in show 404

25 Sep 2018, 17:21

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 1909 times
2018-09-25_231717.png
2018-09-25_231717.png (17.48 KiB) Viewed 1909 times
I edited the name and added a single underscore before "Horse".  Seems a bit wooky here...
 
User avatar
temabu
Experienced
Topic Author
Posts: 29
Joined: 26 Sep 2008, 17:13

Re: Folders with underscore in show 404

25 Sep 2018, 17:25

Renaming it and removing the underscore fixes the problem.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 11675
Joined: 30 Sep 2006, 03:37

Re: Folders with underscore in show 404

25 Sep 2018, 23:43

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.
 
CrisC
Experienced
Posts: 59
Joined: 23 Oct 2018, 05:13

Re: Folders with underscore in show 404

24 Oct 2018, 20:24

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)
 
User avatar
mjau-mjau
X3 Wizard
Posts: 11675
Joined: 30 Sep 2006, 03:37

Re: Folders with underscore in show 404

24 Oct 2018, 22:58

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/.
 
CrisC
Experienced
Posts: 59
Joined: 23 Oct 2018, 05:13

Re: Folders with underscore in show 404

25 Oct 2018, 02:51

yes, that's clear to me - but my question was more: why is it then possible to create / allow those inputs :)
 
User avatar
mjau-mjau
X3 Wizard
Posts: 11675
Joined: 30 Sep 2006, 03:37

Re: Folders with underscore in show 404

25 Oct 2018, 05:13

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.
 
CrisC
Experienced
Posts: 59
Joined: 23 Oct 2018, 05:13

Re: Folders with underscore in show 404

25 Oct 2018, 05:17

alright :) Misunderstood your previous post then :)