I get a 406 Not Acceptable error while having a URL similar to this:
www.example.com/search/find?q=YSBkZXJwIGZyb20gZGVycA~
and it seems to be due to the singular ~
character. I have to base64_encode()
it, using this function:
function base64_url_encode($string = null) {
return strtr(base64_encode($string), '+/=', '-_~');
}
Because the normal base64 encode generates an un-parseable URL.
I've had a look around and came across this answer: PHP/Apache Error:406 Not Acceptable
Which says to disable Mod_Security with:
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
I know I'll have to probably find a different rewrite for the function above, but how could I fix this as to not receive the error again, if there is any way?