how to block old browsers to website entry
I have written a code. I want this code to take us to a webpage if our
browser is a old browser. And I also want to stop image hotlinking. I
don't want image files to talk us to the webpage if the browser is old
browser, But I can not solve the problem. The code:
AddDefaultCharset utf-8
IndexIgnore *
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?mywebsite.com [NC]
RewriteRule [^(banner)]\.(jpg|jpeg|png|gif|svg)$ banner.png [NC]
RewriteCond %{HTTP_USER_AGENT}
!((chrome)|firefox|(msie))(?(3)\s|/)((?(2)19|(?(3)1[^0]|1[6-9]))|[^1]\d|\d{3,})\.|version/([6-9]|\d{2,})\..*safari
[NC]
RewriteRule . error.php [NC]
No comments:
Post a Comment