While adding analytics to this site, cPanel File Manager rejected the file upload twice with HTTP 406 Not Acceptable. The file was fine. The upload was fine. The host's Web Application Firewall was not.
What triggers it
The rejected file contained <script> tags — the analytics snippet. ModSecurity, the WAF running on the host, inspected the upload payload, decided it looked like script injection, and refused it with a 406. This is a server-side security rule, not a bug in File Manager and not a problem with the file itself.
What worked instead
The reliable workaround was cPanel's built-in code editor: create or open the file in File Manager and paste the content there. The editor saves through a different request path that the WAF rule does not block. Uploading a ZIP archive and extracting it server-side also avoids the issue, since the WAF inspects the upload payload rather than the archive contents.
The takeaway
- A 406 on upload usually means the WAF rejected the payload — check whether the file contains script-like content.
- Prefer the built-in editor or ZIP-and-extract for files containing
<script>tags. - Do not "fix" it by weakening the snippet or disabling security rules you do not own.
Shared hosting means sharing the security policy. Knowing which door the WAF watches saves an afternoon. For the permission issues from the same deployment, see deploying a no-framework PHP site on LiteSpeed shared hosting.