使用php或htaccess阻止我的网站上的特定手机制作/型号

I have been getting a lot of hits from the same phone but different ISPs to my site that seem malicious. I would like to block/redirect that whole phone from being able to access my site.

The phone gets registered in my stats as: HTC One M8

How do I go about sending all hits from that make & model to a 404 page on my site using PHP or .htaccess?

You can check user agent and then respond with forbidden status

RewriteCond %{HTTP_USER_AGENT} "HTC One M8" [nocase]
RewriteRule ^.*$ – [forbidden,last]

Note that you need to add exact user agent string here and not forget to escape special characters

But this would should be only temporary fix because you can block legitimate users from accessing your site