Search Our Database

Troubleshooting Website Error 414 (Request URL Too Long) – Parameter in URL

Last updated on |

Introduction

This Knowledge Base guide addresses the issue of URLs that are too long for the server to interpret, resulting in an error. A common reason for this issue is the presence of parameters in the URL, which can cause the server to exceed its URL length limit. This guide explains how to configure the .htaccess file to remove specific parameters from URLs, preventing this error and improving URL readability.

 

Issue

To identify if your URL includes problematic parameters, check if it contains “params.” For example:

https://www.domain.com/?params=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789

If this format appears in your URLs, follow the solution below to remove the parameters.

 

Solution

Step 1: Access the .htaccess File

  1. Log in via SSH as a root user. Use the following command to gain root access:
sudo su -
  1. Navigate to the .htaccess file location in your website directory:
cd /home/<user>/domains/<your domain>/public_html/

 

Step 2: List Files in the Public_HTML Directory

List all files in the public_html directory to confirm the presence of the .htaccess file:

ls -la

 

Step 3: Edit the .htaccess File

  1. Open .htaccess for editing:
vim .htaccess

Press i to enable edit mode.

 

Step 4: Add Rewrite Rules

In the .htaccess file, add the following lines to remove the params parameter from URLs:

  • Enable Rewrite Engine: If the RewriteEngine directive is not already present, add the following line:
RewriteEngine On
  • Add Rewrite Conditions and Rules: Insert the following lines below RewriteEngine On to strip the params parameter from URLs:
RewriteCond %{QUERY_STRING} ^(.*)&?params=[^&]+&?(.*)$ [NC]
RewriteRule ^ %{REQUEST_URI}?%1%2 [R=301,L]

 

Step 5: Save and Close the .htaccess File

  1. Press ESC to exit edit mode.
  2. Type :wq and press Enter to save the changes and close the file.

 

Step 6: Test the URL

Browse the website URL that previously included parameters, such as:

https://www.domain.com/?params=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789

 

The URL should now display as:

https://www.domain.com/

 

indicating that the parameters have been removed.

 

Important Notes

⚠️ Important Note: Always back up your .htaccess file before making changes. This allows you to restore the original version if needed.

 

 

Conclusion

Following these steps should help resolve the 414 error by removing unnecessary parameters from URLs. Your website should now load without exceeding the server’s URL length limit.

For further assistance, or if you encounter any issues, please contact the support team at support@ipserverone.com.