centos - How to block all browsers except firefox at apache server based on useragent , HTTP_USER_AGENT -


i want block browsers, based on useragent string (http_user_agent) received apache server.

have tried following options in mod_rewrite in httpd.conf file , nothing seem work.

<ifmodule mod_rewrite.c> rewriteengine on rewritecond "%{http_user_agent}" "^mozilla/3.*" rewriterule "^index\.html" "nopage.html" [f] </ifmodule> 

didn’t work. tried,

<ifmodule mod_rewrite.c> rewriteengine on rewritecond %{http_user_agent} \ firefox/55 [nc] rewriterule ^ - [f,l] </ifmodule> 

didn’t work. tried,

<ifmodule mod_rewrite.c> rewriteengine on rewritecond %{http_user_agent} firefox [nc] rewriterule .* - [f,l] </ifmodule> 

didn’t work. tried,

<ifmodule mod_rewrite.c> rewriteengine on rewritecond %{http_user_agent} ^firefox/5\.0 rewriterule - [l,r=403,e=firefox] </ifmodule> 

didn’t work. tried,

<ifmodule mod_rewrite.c> rewriteengine on rewritecond %{http_user_agent} "msie 12.0" [nc,or]     rewriterule ^(.*)$ http://192.168.12.60/ [l,r=301] </ifmodule>     

didn’t work.

then don’t know doing wrong.


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

angular - Copying node modules to wwwroot AspNetCore -