# 403 error and index.php file becomes empty after upload

**URL:** <https://forum.infinityfree.com/t/403-error-and-index-php-file-becomes-empty-after-upload/118305>\
**Category:** Hosting Support\
**Created:** [April 15, 2026, 8:14pm UTC](https://forum.infinityfree.com/t/403-error-and-index-php-file-becomes-empty-after-upload/118305 "2026-04-15T20:14:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![OMGGraphics](https://forum.infinityfree.com/letter_avatar/omggraphics/32/6_449c533f586939b6e5f246632a46421f.png) [@OMGGraphics](https://forum.infinityfree.com/u/OMGGraphics)\
**Post date:** [April 15, 2026, 8:14pm UTC](https://forum.infinityfree.com/t/403-error-and-index-php-file-becomes-empty-after-upload/118305/1 "2026-04-15T20:14:29Z")

</div>

### Website URL

[https://omggraphics.great-site.net](https://omggraphics.great-site.net)

### Error Message

# **403 Forbidden**

#### Server or website configuration is blocking you from viewing this page

### Other Information

“My index.php gets wiped after upload, and when I try to create the index.php directly from my file manager and paste my code in it, it shows 0 bytes, and my site shows 403 Forbidden. I’ve confirmed it is in /htdocs but gets wiped during upload.”

---

<div class="post-metadata">

**Author:** ![KangJL](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/kangjl/32/12130_2.png) [@KangJL](https://forum.infinityfree.com/u/KangJL)\
**Post date:** [April 15, 2026, 10:21pm UTC](https://forum.infinityfree.com/t/403-error-and-index-php-file-becomes-empty-after-upload/118305/2 "2026-04-15T22:21:26Z")

</div>

Please read

> [@Why are my files deleted after uploading them](https://forum.infinityfree.com/t/why-are-my-files-deleted-after-uploading-them/49310/1):
>
> Sometimes, when you upload a file, the upload is completed but the file is deleted immediately afterwards. This is usually caused by one of the following issues: The file is not in a htdocs folder All websites files must be uploaded to either the main htdocs folder, or to the domain specific htdocs folder (like example.com/htdocs). You cannot upload files to other directories on your account. If you try to create or upload files anywhere else, they will be deleted automatically. The file type…

---

<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:** [April 22, 2026, 10:22pm UTC](https://forum.infinityfree.com/t/403-error-and-index-php-file-becomes-empty-after-upload/118305/3 "2026-04-22T22:22:27Z")

</div>

Closed on April 22, 2026, 10:22pm UTC

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