Apache 414 Request-URI Too Long

On an Apache server, when accessing a long URL, got 414 Request-URI Too Long

Apache 414 Request-URI Too Long

The error is because the URL is too long, this may be a bug with the web applications. If you pass so much data, you should consider using the HTTP POST method instead of GET request.

To fix this error, edit the apache config file, and add the following 2 lines

LimitRequestLine 40940
LimitRequestFieldSize 40940

On Debian/Ubuntu, create

vi /etc/apache2/conf.d/url-length.conf

On RHEL based OS, create

vi /etc/httpd/conf.d/url-length.conf

Add the following 2 lines

LimitRequestLine 40940
LimitRequestFieldSize 40940

Restart Apache

For Ubuntu/Debian

systemctl restart apache2

For RHEL/AlmaLinux/OracleLinux

systemctl restart httpd

See Nginx HTTP 414 request-URI too large, Apache

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *