I have a Rails app which is throwing exceptions when I get some strange urls with lots of garbage characters. For example
I definitely want to get rid of these Rails exceptions. These queries are never generated by a genuine user.
I was thinking of using RedirectMatch in Apache and just permanently redirect these types of queries to the site's home page.
Question 1: Is that a good idea or is there anything better?
Question 2: How to create rules to do this successfully with enough flexibility so I don't have to write many rules every time a new robot hits my site?
My crude attempt was the following but nothing happens. It doesn't seem to be working at all.
RedirectMatch permanent /\+\+\+\+\+/g https://example.com