Hi. How can I handle this 414 case? I have a directory where you can paste the URL and it will handle it, but when I go to the ‘Error Pages’ section of CPanel, that error does not appear as one of the options.
You might want to add this manually to your .htaccess
file:
ErrorDocument 414 [Link]
InfinityFree didn’t put this into the panel,probably they think that this error is rare,and notice that the code above isn’t guaranteed to work.(Limited .htaccess support)
It isn’t working, unless it takes time to have effect, but thanks anyways.
.htaccess
file doesn’t take time to take effect since it is processes on the server side.Make sure you are editing the htdocs/.htaccess
as the file in the root folder cannot be edited.
Still,infinityfree has limited .htaccess rules support,and it is possible that it just doesn’t work here.
Yeah I just checked it’s in the right location (https://example.com/.htaccess)
Well,then probably it just doesn’t work here.You will need premium hosting for full .htaccess support.
Ok sure I’ll try and find ways to reduce the problem and the implement a feature that allows you to paste in a really long URL so that the website can calculate stuff based on that URL like it would in the search bar. That’s assuming there’s no query string equivalent that can be calculated client side without counting towards the URI length count, and that there is no way for me to change the limit.
Thanks for responding quickly!
What is the character limit for it?
All our Error Pages tool does is generate .htaccess code on your site with the ErrorDocument rule. The Error Page tool only supports URLs, but you can also reference files, or even just put the message directly if you use the .htaccess rules.
I’m not sure if there is a limit on the maximum length of the URL. If there isn’t, the only limit is the 10 kB file size limit for the entire .htaccess file.
There must be a limit otherwise I would never get 414.
Can you give us the URL ?
And are you maybe using Cloudflare?
I have often noticed that it is necessary to purge all cache on CF
when testing the .htaccess file and generally related to error pages
The Error Pages tool in the control panel probably has a limit on the maximum length of a URL it can accept. But I think you can bypass it by just setting up the .htaccess rule by hand, like @Frank419 already told you.
I already tried using what Frank said, the site is quicklink.rf.gd (may not work as I am changing it a lot before checking for errors, and patching them on the server). Copy and paste in the default HTML or something a bunch of times untill it says code is quite long, then use this:
https://quicklink.rf.gd/site/?[generated_code]
The generated code will always start with ‘data=’
My current .htaccess code:
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:CF-Visitor} !{"scheme":"https"}
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{QUERY_STRING} ^(.*)i=[^&]+(.*)$ [NC]
RewriteRule ^(.*)$ /$1?%1%2 [R=301,L]
ErrorDocument 414 https://quicklink.rf.gd/paste-data/
An alternative, I believe, would be using PHP to assign a URL and store the code on the server, and I probably will do that eventually.
How many characters are in the URL string that you’re trying to pass?
According to this page: https://stackoverflow.com/a/417184
URLs over 2,000 characters will not work in the most popular web browsers.
The reason for such a long URL is that it contains all of the page’s code, encrypted.
URL shortener API for js maybe ? It probably wouldn’t work because the same request is being sent to the server
I think that the number of characters is too long.
Maybe store templates on the server and then access them via a hashed name passed to the URL?
I’m not sure how to solve it.