انتقل إلى المحتوى

الدروس استكشاف الأخطاء وإصلاحها مبتدئ1 دقائق قراءة

How to Fix a 400 Bad Request Error

Why a server rejects a request as malformed, and how to fix 400 errors caused by bad URLs, oversized cookies, corrupted cache or large uploads.

بواسطة فريق تحرير ZSOLNET آخر تحديث

هذه الصفحة غير متاحة بالعربية بعد، لذا تُعرض بالإنجليزية.

أهم النقاط

  • A 400 means the server couldn't understand the request your browser sent.
  • Oversized or corrupted cookies for one site are the most common cause.
  • If every visitor sees it, the problem is on the server or in the link itself.

A 400 Bad Request response means the server received a request it considers malformed, so it refused to process it. Unlike a 500 error, the server is healthy — it just didn’t like what it was sent.

Common causes

  • A mistyped or badly encoded URL, such as a stray % or unescaped characters.
  • Cookies for the site that are corrupted or too large.
  • Stale cached data that no longer matches the site.
  • An upload larger than the server allows (some servers return 400 instead of 413).
  • A browser extension rewriting requests.

Fix it as a visitor

  1. Check the address. Retype the URL rather than following the link, and look for unusual characters. Paste it into the URL encoder tool to spot anything that isn’t encoded correctly.
  2. Clear that site’s cookies. In Chrome, click the padlock or settings icon next to the address bar → Cookies and site data → remove the cookies for that site, then reload.
  3. Clear your browser cache or open the page in a private window. If it loads there, cache or cookies were the cause.
  4. Disable extensions one at a time — ad blockers and privacy tools occasionally break requests.
  5. Flush your DNS cache if the site recently moved servers.

Fix it as a site owner

  1. Reproduce it. Use the HTTP headers tool on the failing URL and note the exact response.
  2. Check the error log. In cPanel open Metrics → Errors; on a VPS look at /var/log/nginx/error.log or /var/log/apache2/error.log.
  3. Raise header limits if cookies are large. On Nginx:
# inside the http or server block
large_client_header_buffers 4 16k;
  1. Check upload limits for forms that send files — see the guide to increasing PHP upload limits.
  2. Review recent code changes that build URLs or set cookies. A plugin that sets a new cookie on every page view can push headers past the limit.

الأسئلة الشائعة

Is a 400 error my fault or the website's?

If only you see it, it's almost always local: a bad URL, cookies or cache. If everyone sees it on a specific page, the site's code or configuration is producing invalid requests or rejecting valid ones.

What does 'Request Header Or Cookie Too Large' mean?

It's a variant of 400 from Nginx. The cookies your browser stores for that site have grown past the server's header limit. Clearing that site's cookies fixes it.

شارك X LinkedIn Facebook

الدخول إلى حسابك

أدِر نطاقاتك واستضافتك وفواتيرك من مكان واحد.

اتصال آمن مباشرة مع منطقة العملاء في ZSOLNET.

ليس لديك حساب؟