# AJAX POST returns HTML instead of JSON – Chat not working

**URL:** <https://forum.infinityfree.com/t/ajax-post-returns-html-instead-of-json-chat-not-working/121672>\
**Category:** Hosting Support\
**Created:** [October 30, 2026, 2:34am UTC](https://forum.infinityfree.com/t/ajax-post-returns-html-instead-of-json-chat-not-working/121672 "2026-10-30T02:34:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Axel\_0214](https://forum.infinityfree.com/letter_avatar/axel_0214/32/5_5575768a8748004e209b776fc1b2916d.png) [@Axel\_0214](https://forum.infinityfree.com/u/Axel_0214)\
**Post date:** [October 30, 2026, 2:34am UTC](https://forum.infinityfree.com/t/ajax-post-returns-html-instead-of-json-chat-not-working/121672/1 "2026-10-30T02:34:58Z")

</div>

### Website URL

[https://rldautoworx.kesug.com](https://rldautoworx.kesug.com)

### Error Message

The chat\_send.php AJAX POST request returns HTTP 200 with Content-Type: text/html containing InfinityFree browser verification JavaScript instead of the expected JSON response.

### Other Information

The request already includes the \_\_test cookie. Additionally, customer\_chat.php returns 403 Forbidden, while its copy support\_messages.php loads.

The \_\_test cookie is already included in the request.  
Hard-refreshing the page does not resolve the issue.

---

<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 30, 2026, 2:34am UTC](https://forum.infinityfree.com/t/ajax-post-returns-html-instead-of-json-chat-not-working/121672/2 "2026-10-30T02:34:59Z")

</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 30, 2026, 2:35am UTC](https://forum.infinityfree.com/t/ajax-post-returns-html-instead-of-json-chat-not-working/121672/3 "2026-10-30T02:35:18Z")

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

The 403 on `customer_chat.php` is the “chat” keyword block. The security check page is probably a separate problem, and I’m not sure of its cause yet.

Our 403 article lists “chat” as a blocked keyword in URLs, because live chat scripts constantly refresh pages and create a lot of server load. It says that renaming the files, as you did with `support_messages.php`, gets around the block. It also says hosting live chat scripts is still prohibited, so a chat that polls for new messages could still be a problem on free hosting.

That article is here:

> [@Redirected to InfinityFree 403 Forbidden page](https://forum.infinityfree.com/docs?topic=58664):
>
> Getting a 403 error means the server is refusing to show your webpage. Here are the most common causes and how to fix them: 1. Website Files Are in the Wrong Location The Issue: Your domain might be pointing to an empty or non-existent folder. How to Check: Log into your [InfinityFree client area](https://dash.infinityfree.com) Go to Accounts → [Select your account] → Domains → [Find your domain] → Manage Find the Directory Status card, and look at the Directory displayed there Understanding the folder structure: Your fi…

On the verification page, the browser security article says AJAX calls within your own website work fine. Your `chat_send.php` URL also contains “chat”, so it’s worth renaming it before debugging further. The article describes the page you’re seeing: it loads `/aes.js`, sets a `__test` cookie and redirects to the same URL with `?i=1` added. It says that page is returned to anything that can’t run the check, such as a script or a cross-domain request.

The article is here:

> [@Browser Security System - Features and Limitations](https://forum.infinityfree.com/docs?topic=49353):
>
> InfinityFree uses a security system on all free hosting accounts to ensure your website is accessed by real web browsers, not bots or automated scripts. While this protects your site from malicious traffic, it can affect certain types of access. How the security system works The system checks that visitors can execute JavaScript and accept cookies: features that all modern web browsers support. This verification happens automatically and most website visitors will never notice it. You may occa…

Can you paste the exact URL your `fetch` calls for `chat_send.php`? I’d like to see whether it’s a relative path or a full address, and whether the host matches the page exactly, including `https://` and any `www.`. A cookie set for one host isn’t sent to another, so a mismatch would make the check run again.

---

<div class="post-metadata">

**Author:** ![Axel\_0214](https://forum.infinityfree.com/letter_avatar/axel_0214/32/5_5575768a8748004e209b776fc1b2916d.png) [@Axel\_0214](https://forum.infinityfree.com/u/Axel_0214)\
**Post date:** [October 30, 2026, 2:37am UTC](https://forum.infinityfree.com/t/ajax-post-returns-html-instead-of-json-chat-not-working/121672/4 "2026-10-30T02:37:53Z")

</div>

Thank you for your response.

I checked the browser Network tab and confirmed that both the page and AJAX endpoint use the same origin:

Page: [https://rldautoworx.kesug.com/RLD\_/support\_messages.php](https://rldautoworx.kesug.com/RLD_/support_messages.php)

AJAX endpoint: [https://rldautoworx.kesug.com/RLD\_/chat\_send.php](https://rldautoworx.kesug.com/RLD_/chat_send.php)

The request uses POST with `credentials: 'same-origin'`, and the `__test` cookie is included.

My existing chat currently polls every 3 seconds.

Before making any changes, I would like to confirm:

1. Is renaming `chat_send.php`, `chat_fetch.php`, and other endpoints containing “chat” an acceptable solution to the URL restriction?

2. Is polling-based customer support messaging allowed on InfinityFree free hosting if I reduce the polling frequency, for example to 15–30 seconds?

3. If polling is not allowed, is there a supported alternative for implementing customer support messaging?

I want to comply with InfinityFree’s hosting policies.

Thank you!

---

<div class="post-metadata">

**Author:** ![Meishin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/meishin/32/59902_2.png) [@Meishin](https://forum.infinityfree.com/u/Meishin)\
**Post date:** [October 30, 2026, 3:15am UTC](https://forum.infinityfree.com/t/ajax-post-returns-html-instead-of-json-chat-not-working/121672/5 "2026-10-30T03:15:56Z")

</div>

Anything live is not allowed on free hosting when said code is running on hosting directly. You must find a 3rd-party solution like tawk.to.
