fix 414 request uri too large error in apache

How To Fix 414 Request URI Too Large in Apache

Last updated on June 17th, 2024 at 09:13 am

Web administrators need to be able to troubleshoot problems as soon as they arise. Many times, users get ‘414 Request URI Too Large’ error response when they try to access a URL on a website. This is one of the standard responses in all major web servers such as Apache, NGINX, etc. It is important to understand what this issue is, why it occurs and how to solve it. In this article, we will look at how to fix 414 request URI too large error in Apache server. Similar methods can be used for other servers also.

What is 414 Request URI Too Long Error

If you request a very large URL in web server, then it will very likely give “414 Request URI too large” error message. By default, Apache supports URLs with up to 8177 characters, but sometime users even get error with ~4000 characters in URL. Please note, a URI is, as the name suggests, a universal resource identifier, used to identify every resource on your website, whether it is an address, image, video or any other file. URL is a type of URI meant for resource’s location. So even if you enter a large URL, the server will return ‘URI too long’ instead of saying ‘URL too large’. Please note, you get this error mostly in GET requests because only GET request URLs are really long due to their input URL parameters. POST request URLs are short and contain most of input data as POST data.

Why You Get 414 Request URI Too Long Error

Here are some of the common reasons why people get this error message:

  1. URL Parameters – The most common reason for getting this response is buggy URL parameters, especially if they are programmatically generated. This happens a lot in Ecommerce sites which are notorious for long URLs. They can also occur if you have too many UTM parameters in tracking URLs.
  2. Faulty Configuration – If all URLs on your website return this error, then it may be a configuration issue. Open your server’s configuration to check if there is a limit imposed on URL length. In this article, we have described how to fix this problem.
  3. Faulty plugins – A buggy plugin may also generate long URLs and result in this error. If you find that all URLs pertaining to a given plugin or its features are giving this response, then it may be faulty.
  4. POST to GET conversion – To be honest, most web servers are capable of handling really long URLs. Still, if none of the above points work for you, then may be there is a software bug in your website’s code that converts POST requests to GET. So first check if you get this error for all URLs or only specific ones. If it is only specific ones, then check the request handler for those URLs to see if there is a POST to GET request somewhere on the front end before request submission or back end afterwards.
  5. Redirect Loops – Redirect loops are infinite loops in web browser due to faulty redirection scheme on your web browser. It results in a really long URL and returns this error.

How To Fix 414 Request URI Too Large in Apache

By default, Apache server supports up to 8177 characters in a URL. However, if you need to request large URLs, or are getting errors with smaller URLs itself, then you need to increase the request size limit in Apache. This means changing your server’s configuration.

You can do this by setting LimitRequestLine and LimitRequestFieldSize directives.

1. Open Apache Configuration File

Apache configuration file is located at one of the following locations, depending on your Linux distribution.

  • /etc/apache2/httpd.conf
  • /etc/apache2/apache2.conf
  • /etc/httpd/httpd.conf
  • /etc/httpd/conf/httpd.conf

Open terminal and run the following command to open Apache configuration page.

$ sudo vi /etc/httpd/conf/httpd.conf

If you make changes in Apache server configuration file, it will be applicable for all websites/domains that you run on your Apache web server.

Apache Restrict Access by IP in Virtual Host

If you are running multiple websites on Apache server, using virtual host, then open the virtual host configuration file of the website (e.g for which you want to deny access to IP. Let’s say your virtual host configuration file is located at /etc/apache2/sites-enabled/website.conf

$ sudo vi /etc/apache2/sites-enabled/website.conf

2. Increase URI limit

To fix 414 Request URI too large error, you need to set LimitRequestLine directive.

If you want to increase URL limit to 10000 characters (bytes), add the following lines to your server configuration or virtual host file.

LimitRequestLine 10000

If you also want to increase maximum header length supported by Apache to 4000 characters, then add the following line to server configuration or virtual host file.

LimitRequestFieldSize 4000

Basically, you need to specify the required number of bytes after LimitRequestLine and LineRequestFieldSize directives.

Bonus Tip: If you are using NGINX server, look for large_client_header_buffers instead of LimitRequestLine and increase its value, just as you would with LimitRequestLine.

3. Restart Apache web server

Restart Apache web server to apply changes.

# service httpd restart
# systemctl restart httpd
# sudo service apache2 restart

Now when a user tries to request a long URL they will not get “414 Request URI too long” error.


In this article, we have learnt how to fix ‘414 Request URI Too Large’ problem in Apache. We have also mentioned a bonus tip to fix the same problem in NGINX server. The key is to understand why you get this error. In most cases, you do not have to change the configuration file. It is generally a result of faulty plugin or buggy redirects. It can also be due to bugs in the request handler of URL on server side or request submission at client side.

Ubiq makes it easy to visualize data in minutes, and monitor in real-time dashboards. Try it today!

Also read
How to Enable Apache Server Status Dashboard
Apache Restrict Access to URL by IP
How to Enable HTTP2 in Apache