Strange one but how do I stop this from happening?

If I type anything after /?category it jumps to my homepage... for example

www.mywebsite.com/?category=this_just__goes_to_the_homepage

A malicious competitor might spot that and create 1000s of URLs with not-so-nice naming conventions and have them indexed. That would create a clean-up nightmare.

If a category does not exist how do I make sure it results in a 404 error page.

Many thanks.