# Title: PHP files in htdocs return 404 even though files exist

**URL:** <https://forum.infinityfree.com/t/title-php-files-in-htdocs-return-404-even-though-files-exist/121194>\
**Category:** Hosting Support\
**Created:** [October 9, 2026, 6:41pm UTC](https://forum.infinityfree.com/t/title-php-files-in-htdocs-return-404-even-though-files-exist/121194 "2026-10-09T18:41:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rakib\_Mahin](https://forum.infinityfree.com/letter_avatar/rakib_mahin/32/6_449c533f586939b6e5f246632a46421f.png) [@Rakib\_Mahin](https://forum.infinityfree.com/u/Rakib_Mahin)\
**Post date:** [October 9, 2026, 6:41pm UTC](https://forum.infinityfree.com/t/title-php-files-in-htdocs-return-404-even-though-files-exist/121194/1 "2026-10-09T18:41:53Z")

</div>

### Website URL

[http://learnspace.rf.gd](http://learnspace.rf.gd)

### Error Message

Title: PHP files in htdocs return 404 even though files exist

Hello, my website is [https://learnspace.rf.gd/](https://learnspace.rf.gd/)

My “index.html” homepage loads when I visit the root domain, and “make\_hash.php” also opens. However, “admin.php” and “index.html” return a 404 error when opened directly.

### Other Information

I confirmed that “admin.php” is located at “/htdocs/admin.php”, alongside “index.html” and “config.php”. The files exist in the hosting File Manager.

Could you please help me identify why these files return 404?

Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [October 9, 2026, 6:41pm UTC](https://forum.infinityfree.com/t/title-php-files-in-htdocs-return-404-even-though-files-exist/121194/2 "2026-10-09T18:41:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Lemni](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/lemni/32/68303_2.png) [@Lemni](https://forum.infinityfree.com/u/Lemni)\
**Post date:** [October 9, 2026, 6:42pm UTC](https://forum.infinityfree.com/t/title-php-files-in-htdocs-return-404-even-though-files-exist/121194/3 "2026-10-09T18:42:06Z")

</div>

_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._

Could you post the exact URLs that return 404, copied from the address bar, for `admin.php` and for `index.html` opened directly? Please also say whether there’s a `.htaccess` file in `htdocs`, and if so, paste what’s in it. Your post says `index.html` both loads and gives a 404, so I need to see which URL does which.

Since `index.html` and `make_hash.php` load, your domain is linked to the right folder. That points at something about those particular URLs or files, not the whole site. I found an article on what a 404 means on our hosting, and these are the causes in it that fit:

> [@Redirected to InfinityFree 404 error page](https://forum.infinityfree.com/docs?topic=49355):
>
> While working on your website, you may be redirected to the [InfinityFree 404 error page](https://infinityfree.net/errors/404/). This article explains why this typically happens and what you can do to fix this. Why do I get a 404 error When you try to access a file on a website, the server tries to find the matching file to load. By default, it works like this. Suppose you have a website [http://example.com](http://example.com) which is linked to the folder htdocs in your hosting account. If you then try to load a certain URL, like [http://example.com/blo…](http://example.com/blog/images/gallery/photo.jpg)

- **Exact name:** File names are case sensitive, so `Admin.php` and `admin.php` are different files.
- **No `htdocs` in the URL:** The URL should be `/admin.php`, not `/htdocs/admin.php`.
- **`.htaccess` rules:** Rewrite rules can send some URLs to a 404 even though the file exists.

I can’t tell yet which of these it is, if any. The exact URLs and the `.htaccess` contents should narrow it down.

---

<div class="post-metadata">

**Author:** ![Rakib\_Mahin](https://forum.infinityfree.com/letter_avatar/rakib_mahin/32/6_449c533f586939b6e5f246632a46421f.png) [@Rakib\_Mahin](https://forum.infinityfree.com/u/Rakib_Mahin)\
**Post date:** [October 9, 2026, 6:46pm UTC](https://forum.infinityfree.com/t/title-php-files-in-htdocs-return-404-even-though-files-exist/121194/4 "2026-10-09T18:46:44Z")

</div>

Thank you for your reply.

Here are the exact URLs:

- `https://learnspace.rf.gd/admin.php` — returns 404.
- `https://learnspace.rf.gd/index.html` — returns 404 when opened directly.
- `https://learnspace.rf.gd/` — the homepage loads.
- `https://learnspace.rf.gd/make_hash.php` — opens successfully.

There is a `.htaccess` file inside `htdocs`. Its current contents are:

```apache
Options -Indexes
DirectoryIndex index.html index.php

<Files "data.json">
    Require all denied
</Files>

<Files "config.php">
    Require all denied
</Files>

```

The files `admin.php` and `index.html` are in `/htdocs/`, and their names are exactly as written above.

Could you please help me investigate why the direct URLs return 404?

---

<div class="post-metadata">

**Author:** ![Candev](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/candev/32/68287_2.png) [@Candev](https://forum.infinityfree.com/u/Candev)\
**Post date:** [October 9, 2026, 6:51pm UTC](https://forum.infinityfree.com/t/title-php-files-in-htdocs-return-404-even-though-files-exist/121194/5 "2026-10-09T18:51:23Z")

</div>

Works for me

 ![image](https://forum-cdn.infinityfree.net/original/3X/4/8/487b8c1874acd750129449295a9baea24864e703.jpeg)

Try clearing your cache.

---

<div class="post-metadata">

**Author:** ![Rakib\_Mahin](https://forum.infinityfree.com/letter_avatar/rakib_mahin/32/6_449c533f586939b6e5f246632a46421f.png) [@Rakib\_Mahin](https://forum.infinityfree.com/u/Rakib_Mahin)\
**Post date:** [October 9, 2026, 8:55pm UTC](https://forum.infinityfree.com/t/title-php-files-in-htdocs-return-404-even-though-files-exist/121194/6 "2026-10-09T20:55:38Z")

</div>

I cleared my browser cache, but the issue persists. `https://learnspace.rf.gd/` loads the login page, and `https://learnspace.rf.gd/make_hash.php` works. However, `/admin.php` and `/index.html` still return 404. Could you please check whether this is a server-side caching or routing issue?

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [October 10, 2026, 11:41am UTC](https://forum.infinityfree.com/t/title-php-files-in-htdocs-return-404-even-though-files-exist/121194/7 "2026-10-10T11:41:00Z")

</div>

I checked your website and it seems to be working fine from here too.

We don’t have server side cache, and routing is controlled by your .htaccess configuration. Our browsers do enforce strong browser cache by default, but only on static files (including HTML files), not on PHP output. The index.html and home page behaving differently despite being the same file is consistent with browser caching too.

The URL `https://learnspace.rf.gd/admin.php` redirects me back to `https://learnspace.rf.gd/index.html`, and that URL also works for me.

One thing you should check: does the admin.php URL return the 404 error directly or does it redirect to the index.html file which returns the 404 error? What does the URL in the address bar say when you try to navigate to `https://learnspace.rf.gd/admin.php`?

Also, could you check your website in Incognito Mode and see if you get the same behavior there? That’s usually even more effective at circumventing cache than just clearing it, which has the tendency to not clear everything.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [October 17, 2026, 11:41am UTC](https://forum.infinityfree.com/t/title-php-files-in-htdocs-return-404-even-though-files-exist/121194/8 "2026-10-17T11:41:42Z")

</div>

Closed on October 17, 2026, 11:41am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
