Support » Plugin: NinjaFirewall (WP Edition) - Advanced Security » firewall interferes with addon domains running php7

  • Resolved derekakelly

    (@derekakelly)


    When I have your firewall enabled on my hosting account’s main domain. Any addon domain running php7 will “auto_prepend_file” it as well and cause problems. php7 apparently checks the main domain’s directory and applies .user.ini configuration to other domains.

Viewing 1 replies (of 1 total)
  • Plugin Author nintechnet

    (@nintechnet)

    Depending on your server configuration, this problem can indeed happen. There are a few options though. The first one I recommend is to used the .htninja user script to tell the firewall to filter only the main domain.
    Assuming that your main site is “domain.tld” or “www.domain.tld”, you could use this code:

    <?php
    /*
     +===================================================================+
     | NinjaFirewall optional configuration file                         |
     |                                                                   |
     | See: https://nintechnet.com/ninjafirewall/wp-edition/help/?htninja|
     +===================================================================+
    */
    
    // If the requested host is not "domain.tld", ignore it:
    if ( stripos( $_SERVER['HTTP_HOST'], 'domain.tld') === FALSE ) {
       return 'ALLOW';
    }
    

    Note that it will match “domain.tld”, “www.domain.tld”, “WWW.DOMAIN.TLD”, but also “sub.domain.tld”.

Viewing 1 replies (of 1 total)
  • The topic ‘firewall interferes with addon domains running php7’ is closed to new replies.