itch.io
itch.io copied to clipboard
Serve index.html when HTML game makes request to folder
Is your feature request related to a problem? Please describe. Currently, when a browser-playable game makes a request to something that is not a file, it'll get a 403 error, as outlined in the Common Pitfalls section of the upload guide.
In most cases, this seems like a reasonable behavior, except when navigating to or requesting sub-pages. In that case, most web servers treat a request to some directory with no additional context as a request for its index.html file.
Describe the solution you'd like The itch.io server should also treat requests to folders as requests to their index.html files.
Describe alternatives you've considered
The alternative is not to do this which is largely fine since this is an easy fix in most setups.
But it is still an inconvenience and, in my case, it'd mean that my standalone website version would also navigate to index.html in the URL bar which I find to be a bit ugly.
Additional context This has caused problems with Construct 3 before, in issue #1383 The same request was made there but since the issue is closed, it didn't really go anywhere.
Unlikely we'll make this change unless there's a really compelling reason to. Game files are served directly out of a cloud storage bucket, there is no application logic there to attempt to find an index file for a directory style URL. People who are accessing games should be accessing it through itch.io, which will select the correct entry point of the game. Exported game code should be aware of the files created by the export and only navigate to those files.
It is my opinion that what Construct is doing in this case is based on the assumptions that the game will be hosted on a specific kind of webserver, I have no idea why they would try to make a request to a URL path that isn't in the list of generated files when the export is created, it could be a legacy reason. In any case, they should be able to respond to that error without crashing the game.