Wordpress.org has several plugin that handle re-direct for errors. You will need to read the documentation on the ones of interest. Then download and install the ones of interest and play with them. Note only have one at a time active. You will also need somewhere to send your visitor when you redirect them. It could be anywhere - a page, post on your site, another website, anywhere. But it has to go somewhere or the plugin will not know what to do.
Their is a couple of wordpress.org plugins that I've used (and still do) that when someone comes from a country to my site and my site has nothing to offer them, I will redirect them elsewhere. I also use it to block various countries and I.P.