New subdomain returns 404 for all uploaded files

Website URL

https://aquasalt-demo.freedev.app/

Error Message

404 not found

Other Information

Hello InfinityFree Support,

I created the subdomain aquasalt-demo.freedev.app today, and my hosting account is Active.

My subdomain’s home directory is:

/home/vol14_8/infinityfree.com/if0_43204976/htdocs

I uploaded my Laravel application’s files through FileZilla to /htdocs. However, the homepage returns 404 Not Found. Direct requests to /index.php, /public/index.php, and simple test files such as /hello.txt and /deployment-check/check.txt also return 404.

Could you please verify that the subdomain is correctly mapped to the intended document root and that the web server is serving files from my account?

Thank you.

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.

I can’t tell yet what’s causing this, so I need two details.

First, what does the 404 page say? Is it a plain page reading “We couldn’t find that page” (the host’s own 404), or something Laravel generated? Please quote the text.

Second, is there an .htaccess file in htdocs, and if so, what’s in it? The Laravel guide on this forum uses an .htaccess that rewrites every request into the public folder. Under that rule, /hello.txt becomes /public/hello.txt, and a file sitting directly in htdocs would return 404. Your symptoms could match that. It could also be something else, such as the files not being in htdocs, and nothing here confirms which. Here’s the guide:

If you delete or rename .htaccess and /hello.txt still returns 404, tell me. At that point it’s more likely a problem with the account or server than with your files, and a person would need to look at it.

Thanks for looking into this.

The 404 page displays “404 Not Found” in plain text; it does not appear to be a Laravel-generated error page.

Yes, there is an .htaccess file in /htdocs. Its contents are:

Options -Indexes

<IfModule mod_authz_core.c>
    <FilesMatch "(?i)^(?:\.env(?:\..*)?|artisan|composer\.(?:json|lock)|phpunit\.xml|vite\.config\.js|package(?:-lock)?\.json)$">
        Require all denied
    </FilesMatch>
    <FilesMatch "^\.">
        Require all denied
    </FilesMatch>
</IfModule>

<IfModule !mod_authz_core.c>
    <FilesMatch "(?i)^(?:\.env(?:\..*)?|artisan|composer\.(?:json|lock)|phpunit\.xml|vite\.config\.js|package(?:-lock)?\.json)$">
        Order Allow,Deny
        Deny from all
    </FilesMatch>
    <FilesMatch "^\.">
        Order Allow,Deny
        Deny from all
    </FilesMatch>
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^(?:app|bootstrap|config|database|resources|routes|storage|tests|vendor|node_modules|\.git)(?:/|$) - [F,L,NC]
    RewriteRule ^public/storage(?:/|$) - [F,L,NC]
    RewriteRule ^public/ - [L]
    RewriteRule ^$ public/index.php [L]
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

The subdomain is aquasalt-demo.freedev.app, and the hosting account shows Active. My files are uploaded to /htdocs, and public/index.php exists.

Before I remove or rename .htaccess, could you confirm the safest way to test whether this rewrite configuration is causing the 404 without exposing Laravel’s private files?

Is this the 404 error you see as well?

Because that’s the page I see when I try to access https://aquasalt-demo.freedev.app//hello.txt, and that page is 100% the 404 error page from Laravel, not from our hosting.

I had a quick look at the .htaccess file in the htdocs folder, and it appears to be completely custom. I suspect the error is in there. I have written a different guide on how to setup Laravel that uses different .htaccess rules that have been tested on our hosting.

I wouldn’t worry about this too much for a quick test, but one simple but effective way to do this is to setup temporary IP allowlisting on your website.

To do so, instead of completely removing the .htaccess file, replace it with a file that only has this line:

Require ip xx.xx.xx.xx

Replace the xx.xx.xx.xx with your own IP address.

That way, only you and other people on your IP address can access your website, while blocking the rest of the world.

Another option is by using Password Protected Directories, but that’s more likely to break if you’re moving .htaccess files around, so I wouldn’t recommend that approach.