• Resolved SEO Hungary

    (@pontkom)


    HI

    Great WP plugin! I run into the following problem, i have another script installed under /home/something if i turn on NF i cant create session for that script i have to login 10 times to make any change….always log me out. If i run off NF everything comes back to normal.

    Im on shared cpanel hosting i have few addon domain under /home i see the same problem under those dir.

    Thanx
    Sam

    https://www.ads-software.com/plugins/ninjafirewall/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author nintechnet

    (@nintechnet)

    Hi,

    If you want to disable the firewall for one or more subfolders, you can use the .htninja configuration file.
    For instance, to whitelist the /foo/bar/ directory:

    <?php
    /*
     +===================================================================+
     | NinjaFirewall optional configuration file                         |
     |                                                                   |
     | See: https://nintechnet.com/ninjafirewall/wp-edition/help/?htninja |
     +===================================================================+
    */
    
    if (strpos($_SERVER['SCRIPT_NAME'], '/foo/bar/') !== FALSE) {
       return 'ALLOW';
    }

    Thread Starter SEO Hungary

    (@pontkom)

    HI

    I did but didnt help, i created new file named it .htninja i copied what you sent i changed the folder name etc….still making the same problem.
    NF see the Optional configuration file but not working, i want to disable for example:
    home/user/public_html/subfolder

    so i changed the code

    if (strpos($_SERVER[‘SCRIPT_NAME’], ‘/subfolder/’) !== FALSE) {
    return ‘ALLOW’;
    }

    Not working….Pls help me.

    Thanx

    Plugin Author nintechnet

    (@nintechnet)

    Maybe you can try $_SERVER[‘SCRIPT_FILENAME’] instead of $_SERVER[‘SCRIPT_NAME’]?

    Thread Starter SEO Hungary

    (@pontkom)

    HI

    Great working! What if i need to add more directory? Thanx a lot
    Sam

    Plugin Author nintechnet

    (@nintechnet)

    You can add as many as you want:

    if ( strpos($_SERVER['SCRIPT_FILENAME'], '/somefolder/')    !== FALSE ||
         strpos($_SERVER['SCRIPT_FILENAME'], '/subfolder/')     !== FALSE ||
         strpos($_SERVER['SCRIPT_FILENAME'], '/anotherfolder/') !== FALSE ) {
       return 'ALLOW';
    }
    Thread Starter SEO Hungary

    (@pontkom)

    Thanx a lot! Great plugin, great support:)

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Subfolder problem’ is closed to new replies.