How can I apply a rule with mod_rewrite only开发者_Go百科 if a file is directly accessed? (No referrer is detected)
I have this so far but it does not seem to work:
RewriteCond %{HTTP_REFERER} !^(.*) 
If you're looking to match an empty string, it's better to use the equality operator than a regex. So, whilst Gumbo's answer will work, it would be better to use
RewriteCond %{HTTP_REFERER} !=""
As .* matches anything (even the empty string), this condition will never be fulfilled. Either use !^(.+) or simply ^$:
RewriteCond %{HTTP_REFERER} !^$
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论