403 Forbidden on habittracker.php — file/permissions look correct

Website URL

https://leldorabloom.xo.je/habittracker.php

Error Message

403 Forbidden
Server or website configuration is blocking me from viewing this page

Other Information

I have several PHP files in htdocs on this account. One of them, leldoraprogram.php,
loads correctly. Another file, habittracker.php, returns a 403 Forbidden error every
time it’s accessed, even directly by URL.

Things I’ve already checked:

  • The file is in the correct htdocs folder (confirmed via FTP)
  • File permissions are 644, identical to leldoraprogram.php which works fine
  • There is no .htaccess file in htdocs that could be blocking it
  • The filename doesn’t contain any of the documented blocked keywords
    (“chat”, “includes”)
  • File size looks correct/normal for the code it contains, so it doesn’t appear
    to be a failed/corrupted upload

Could this be a WAF/ModSecurity false positive similar to other reports in this
forum? Any help figuring out what’s blocking this specific file would be appreciated.

hello, actually, if you use any api or something like that which has expired (or the key isnt present), it could give you a 403 FORBIDDEN

oh and i got this response from the google ai assistance:
The request is failing because the server has intentionally refused to authorize your access to the requested resource.

Root Cause: A server-side restriction or website configuration is blocking the request. Since this is an InfinityFree error page, the underlying host has likely implemented security rules, IP blocking, or directory permissions that forbid your specific request.

Suggestions:

  • Check .htaccess: If you are the site owner, ensure your .htaccess file does not have Deny from all rules or incorrect IP restrictions.
  • Verify Directory Permissions: Ensure the target folder has 0755 permissions and the target file has 0644 permissions.
  • Verify File Existence: Some hosting configurations return a 403 Forbidden instead of a 404 Not Found if an index file (e.g., index.php or index.html) is missing and directory listing is disabled.
  • Check WAF/Security Settings: Disable any security plugins (like Wordfence or Cloudflare rules) temporarily to see if they are triggering a false positive block.

You can’t host API’s on InfinityFree. But I don’t think that’s the problem here.

False positives are few and far between. Lots of people say they’re getting a false positives from the security system. But I’ve not seen any yet that actually are in the nearly 2 years I’ve been here.

First, can you replace the body of the habittracker.php with some kind of basic hello world type message?
If that still triggers a 403 (after a cache clear) then it’s something about the URL is triggering the 403.

If the hello world text works, then something about the page itself is triggering. Since this is a community forum, we don’t have any access to your code so you’ll need to share more details about the actual page, and what it’s doing for us to be able to help

no actually, i was not talking about hosting api(s) on infinityfree, if they use a api just to load the page or something like that, and the key(s) are expired, then it can be a 403 problem

Then you did not understand the problem. The OP is experiencing 403 on his website directly, not an API returning 403 breaking functionality.

then it also could be a sql connection error (i have also experienced it)

While possible, its unlikely. SQL errors more often result in either a 500 error (PHP code crashing) or just missing data. It would be unusual for it to cause a 403 error.

Either way, we can’t really speculate any more until @KathleenKaren provides more info as above

habittracker.php seems to contain a blocked keyword tracker.php that results in 403.

This mean that the most straightforward solution would be renaming your file.

I didnt know “tracker” was one of the banned key words. Good to know

I see this post and decided that there might be a blocked keyword undocumented so I tried it out by myself.

And for reference it is tracker.php. tracker itself doesn’t seem to trigger a 403.