Page 1 of 1
help: URLs in Sitemap.xml 404 error
Posted: 20 Nov 2024, 02:34
by BeastTL
I apologize that my English is not good enough to read the numerous existing posts on your support forum smoothly, so I am using a translator to ask the questions I have encountered, hoping to receive your answers.
I created my sitemap.xml with Sitemap Creator, but after being indexed by Google, there are a large number of 404 errors. After checking this XML, I found the following example:
Link generated by sitemap: /beer/2016/Belhaven_Scottish_Ale_20160303_130549/
Actual link: /content/beer/2016/Belhaven_Scottish%20Ale_20160303_130549.jpg
The link generated by the sitemap is causing 404 errors. I suspect that there might be an issue with my Nginx URL rewrite, but I am not sure if this is the problem, nor do I know how to resolve it. I hope to get your assistance.
Re: help: URLs in Sitemap.xml 404 error
Posted: 20 Nov 2024, 06:15
by mjau-mjau
Hi. From your link, I can already see what the problem is. It's not your fault, but it's a logical limitation of X3. It's related to file names that include BOTH _underscore and empty spaces (%20) in the file name. Explanation:
X3 needs to create a PAGE url from your image names, and will replace %20 with _underscore. For example "image name.jpg" will create a page url segment /image_name/. Then when /image_name/ loads into browser, it will look for both "image_name.jpg" and "image name.jpg", which will successfully locate the image. However, in your case with page url "Belhaven_Scottish_Ale_20160303_130549", how does it know the file name to look for? It will try "Belhaven_Scottish_Ale_20160303_130549.jpg" and "Belhaven Scottish Ale 20160303 130549.jpg", but both will fail.
In conclusion, you need to rename your images to not contain both empty spaces and underscore. The most natural thing to do, would be to replace empty spaces (%20) with _underscore. Although empty spaces do work in the gallery, it creates complications when creating page urls from images, or more specifically when combined in file names with _underscore (like in your case).
Re: help: URLs in Sitemap.xml 404 error
Posted: 20 Nov 2024, 08:16
by BeastTL
Oh, renaming... I have thousands of pictures, and almost every single one of them contains both spaces and underscores, which would be a huge workload :(
Moreover, the spaces and underscores in my naming convention are meaningful, and I want the file storage on my website to be the same as on my hard drive, which is one of the reasons I chose X3, a photo album based on the file system.
...
It seems I will have to accept this issue.
Anyway, thank you for your answers~~
Re: help: URLs in Sitemap.xml 404 error
Posted: 20 Nov 2024, 20:39
by mjau-mjau
I understand, but from a web perspective, if you want to be able to create "nice" urls, also for "image landing pages", your file names need to adhere to certain standards. For example, you should normally always use -hyphens instead of empty spaces. Why? Because empty spaces are not url-friendly, and need to be encoded ... /this%20does%20not%20look%nice/ while /this-looks-perfectly-fine/
There are batch-converter applications, that could for example replace all empty spaces in your file names with -hyphens. I don't see how this would be less meaningful. Personally, I never ever use empty spaces in file names, just as a precaution.
However, if I was you, I would just delete the images sitemap xml that you created. Google will still find all your pages, and it's debatable if there are any advantages at all by using the images sitemap. In most cases, it's unlikely.