Bad requests can be thrown at multiple stages
Various parts of your server/app can throw Bad Request responses to the client. To find out how to solve them, you first have to recognize them. In your case, the Bad Request error generated by Code Igniter has a bit of styling and specifically mentions The URI you submitted has disallowed characters.
. The Bad Request error generated by the webserver just returns Bad Request - Invalid URL
.
Fix bad request errors on the app level
CodeIgniter by default only allows a subset of characters to be in the URI. If you want to change that behavior, look into /system/application/config/config.php
. There is a $config['permitted_uri_chars']
variable. By default it'll look like $config['permitted_uri_chars'] = 'a-z 0-9~%.:&_\-';
. You can change it to an empty string. That will solve your problem, but it's not secure.
Related: Codeigniter Redirect -- The URI you submitted has disallowed characters
Fix bad request errors on the server level
You have to find out what triggers the error. Consult your error log, and if it does not return anything useful, turn on debugging. First guesses for this error could be the URL being too long or that the server has to be configured to accept (certain) multibyte characters. As this issue is no longer related to programming but to configuring a web server, further advice should be sought at ServerFault.