Need full Taxonomy URL to be valid else redirect 404
If you are using contextual filter, then there is validation criteria in settings of taxonomy term name you have selected. 

Then add filter value type as taxonomy term name and add action as page not found. 


You will get the result.