.htaccess Allow All from Specific User Agent

前端 未结 5 1119
故里飘歌
故里飘歌 2020-12-07 21:48

I have a website I am developing that is also going to be pulled into a web app. I have the following code in my .htaccess file to prevent access from ANYONE th

5条回答
  •  心在旅途
    2020-12-07 22:50

    SetEnvIfNoCase User-Agent .*google.* search_robot
    SetEnvIfNoCase User-Agent .*yahoo.* search_robot
    SetEnvIfNoCase User-Agent .*bot.* search_robot
    SetEnvIfNoCase User-Agent .*ask.* search_robot
    
    Order Deny,Allow
    Deny from All
    Allow from env=search_robot
    

    Htaccess SetEnvIf and SetEnvIfNoCase Examples

提交回复
热议问题