Note to mods: If this post is in the wrong category, please move it.
I have a website where, on Windows, works fine, no matter if I go to /API or /api, it will always go to the API folder. However, using InfinityFree, we cannot go to a page if the folder is named “API”, and we try to go to “example.com/Api” you will get a 404 error. Why can’t we change this setting? Using the 2 .htaccess rules:
CheckSpelling on
CheckCaseOnly On
does not seem to work at all. Is there a way that this can be toggled? I don’t want to go through my source code for my app to change a good majority of the URLs, which is mainly my fault because it’s tedious. If this could be changed, it would probably benefit a good majority of users who are programming on Windows and use InfinityFree for hosting.
Because it’s not a setting. It’s an inherent characteristic of the file system (i.e. operating system) being used. Files in Windows are case insensitive, files on Linux are case sensitive. There are fundamental technical differences between the two operating systems which you can’t just turn on or off.
The right way to fix this issue is to fix your broken URLs. And be careful and consistent with casing in your file names and URLs when developing your site.
mod_speling (note the intentional mistype) is a dirty hack for Windows users, and definitely not something that should be relied on a way to correctly operate a web server. On Linux, TestPage.php and testpage.php are different files. Expecting the server to guess which file to load when TESTPAGE.PHP is being requested makes no sense.
Bugs can occur when your development and your live environment are different. To that end, it would be better if you could develop your website on Linux (could you run a LAMP stack in WSL?) so you could avoid these issues.