Using Really Simple SSL with a custom wp-config.php file

Really Simple Security writes some rules to the wp-config.php file on your WordPress site, for instance, to load the Firewall and Security Headers. But it could be that your WordPress installation uses a ‘custom’ file, instead of the standard wp-config.php file on a standard WordPress installation.

For example, the hosting provider Convesio uses a file called wp-convesio.php, and any changes that the Really Simple SSL plugin makes to the “standard” wp-config.php file would get overwritten & lost as a result.

To account for such situations Really Simple Security contains a filter, rsssl_wpconfig_path, which allows you to override this. This tells the plugin to write the necessary rules to your custom wp-config.php file instead, preventing them from being overwritten.

Overriding the default wp-config.php file with a filter

rsssl_wpconfig_path is the filter that allows you to change the file/path where these rules should be added to. For example, if you want the plugin to add the rules to a file called wp-convesio.php, located in the same folder as the standard wp-config.php:

You can add this snippet in a new .php file, and upload that file to the /wp-content/mu-plugins/ folder on your site for it to take effect.

<?php
add_filter('rsssl_wpconfig_path', function($path) {
    return ABSPATH . 'wp-convesio.php';
});

After saving any setting in the plugin with the above code added, the lines will be added to the wp-convesio.php file instead.

Note: the ‘custom’ wp-config.php file that you select, must at least contain the opening <?php tag for Really Simple Security to recognize it.

Simple and Performant Security.
Easily improve site security with WordPress Hardening, Two-Factor Authentication (2FA), Login Protection, Vulnerability Detection and SSL certificate generation.