Wrong htaccess file is written too
-
Add option for custom .htaccess file location for customized WordPress setups.
Many companies and people set up their WordPress install similar to https://github.com/markjaquith/WordPress-Skeleton
This allows using moving the wp-content folder and using Github and Composer to automatically deploy and update WordPress.
However, this setup requires that WordPress is installed in a directory underneath the served root (the index.php and wp-config.php files are modified to point to that directory) and thus Wordfence security writes to the wrong .htaccess file (the correct one is in the root folder along side the modified index/wp-config files).
I’m thinking that adding a constant to the wp-config file would do:
define(‘HTACCESS’, dirname( __FILE__ ).’/.htaccess’);
that way, when your plugin tried to write to the htaccess file it would say:
if( defined(‘HTACCESS)){
#write to this location
}else{
#business as usual
}
The topic ‘Wrong htaccess file is written too’ is closed to new replies.