By default, Apache’s maximum URL length is 8177 characters, which is good for most websites. However, if you want to increase max URL length in Apache to support long URLs, then here are the steps to do it.
How to Increase Max URL Length in Apache
Apache’s default URL length of 8177 characters is sufficient for most websites. However, if your requests exceed this limit, then Apache will throw a “Request-URI too large” error. To fix this problem, we will increase the max URL length in Apache.
Here are the steps to increase max URL length in Apache using LimitRequestLine directive. You can use these steps to increase max URL length in Apache in Ubuntu/Debian systems as well as CentOS/Redhat/Fedora Linux.
1. Open Apache configuration file
Open Apache configuration file in a text editor. You will find the Apache server configuration file located at one of the following locations, depending on your installation.
$ sudo vi /etc/apache2/apache2.conf
Bonus Read : How to Increase Max Connections in Apache
2. Increase Max URL length in Apache
We will use the LimitRequestLine directive to increase max URL length. Here’s the syntax of
In the above directive, you need to specify NumberOfBytes as the new max url length for Apache.
If you want to increase max URL length in Apache to 100000 characters, just add the following line to your Apache server configuration file.
Bonus Read : How to Configure Apache Load Balancer
3. Restart Apache Web Server
Restart Apache server to apply changes.
$ sudo service apache2 restart
$ sudo service httpd restart
Bonus Read : Apache Reverse Proxy Configuration