Files in subfolders return 404, but files directly inside htdocs work

Website URL

https://php-projects.rf.gd/

Error Message

Files inside subfolders return a 404 Not Found error.

/testfolder/test.html — 404 Not Found
/BankAccountManagementSystem/index.php — 404 Not Found
Accessing /testfolder/test.html over HTTP returns a 502 Bad Gateway error from OpenResty.

Files directly inside htdocs work correctly.

Other Information

Hello!

I’m hosting a PHP project on InfinityFree, and I’m having trouble accessing files inside subfolders.

My domain is php-projects.rf.gd, and its configured directory is htdocs.

Here are my test results:

The file /test.html works correctly and displays my test message.
The file /testfolder/test.html returns a 404 Not Found error.
The file /BankAccountManagementSystem/index.php also returns a 404 Not Found error.
The files are visible in File Manager and are located inside the expected folders.
Accessing /testfolder/test.html over HTTP returns a 502 Bad Gateway error from OpenResty.
I checked the htdocs directory and confirmed that no .htaccess file is present.

Since files directly inside htdocs work but files inside subfolders do not, could this be related to subdirectory routing, document root configuration, or server-side handling?

Could you please help me identify the cause and suggest a solution?

Thank you for your time and support!

Welcome to the InfinityFree community forum! Good to have you here.

  • Most people answering here are volunteers. They’re often the fastest source of help. Admin (the only staff member) checks in about once a day for issues on our end.
  • Volunteers can’t see your account or website. Share what you actually see, like error messages and what happens when you try something. That’s more useful than your theory of what’s wrong.
  • AI tools often get InfinityFree wrong. If a volunteer’s advice differs from what an AI told you, please try the volunteer’s suggestion first.
  • Solving an issue is a joint effort. Try the suggestions you get and report back what happened.

Beep boop, I’m a bot! I dug through the forum to get you started. I sometimes get things wrong though, so do with this what you will until a human has a look.

Can you tell me exactly what you see for https://php-projects.rf.gd/testfolder/test.html, and whether it’s the same every time you load it? Your post mentions both a 404 and a 502 for that same file. Those are different problems, so I need to know which one is happening now. A screenshot or the exact text on the error page would help.

Also, can you tell me the exact path of the file in File Manager, such as htdocs/testfolder/test.html, including upper and lower case? Server paths are case-sensitive, so TestFolder and testfolder are different folders. I also need to know the file is inside htdocs itself and not in a folder next to it.

The 502 may be a separate, temporary issue. Someone else reported a short-lived 502 from OpenResty on the same day, and their site recovered by itself after a few minutes:

That’s only a possible match. I found nothing on the forum that explains subfolders returning 404 while root files work, so the answers to the questions above should show where to look next.

I checked the URL again just now.

  1. HTTPS result:
    https://php-projects.rf.gd/testfolder/test.html
    It consistently shows a 404 Not Found error.

  2. HTTP result:
    Previously, http://php-projects.rf.gd/testfolder/test.html showed a 502 Bad Gateway error from openresty.

  3. File Manager issue:
    When I open htdocs and click the testfolder directory, File Manager displays “Failed to load folder contents”. Therefore, I cannot currently verify the contents of testfolder through File Manager.

  4. Root directory test:
    https://php-projects.rf.gd/test.html loads successfully and displays “Main folder test successful!”

My main project is also affected:
https://php-projects.rf.gd/BankAccountManagementSystem/index.php returns 404.

Could you help me investigate why files in subdirectories are inaccessible and why File Manager cannot load testfolder?

The solution button means that you have your issue sorted out, not that you are asking for solutions. I have removed the status from your post as it seems that you are still seeking help.

Seeing how your folder names contains random uppercase letters makes me worried, as our servers are case sensitive (as with most hosting services), so test and Test are two different files.

Normally we ask people to always use lowercase letters to avoid the confusion, but if you insist on using different cases make sure that it actually matches the file name you have uploaded to your account.

I checked it and I see the issue. The file manager shows this incorrectly, but FileZilla does show it: the actual folder name is not testfolder, it’s testfolder, with four preceding spaces.

So the actual URL to the test.html file is https://php-projects.rf.gd/%20%20%20%20testfolder/test.html.