On an Apache server, when accessing a long URL, got 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
Leave a Reply