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: http://nintechnet.com/ninjafirewall/wp-edition/help/?htninja |
+===================================================================+
*/
if (strpos($_SERVER['SCRIPT_NAME'], '/foo/bar/') !== FALSE) {
return 'ALLOW';
}
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
Maybe you can try $_SERVER[‘SCRIPT_FILENAME’] instead of $_SERVER[‘SCRIPT_NAME’]?
HI
Great working! What if i need to add more directory? Thanx a lot
Sam
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';
}
Thanx a lot! Great plugin, great support:)