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

Really Simple SSL has to write some lines to your wp-config.php file on your environment, for instance, to load the Firewall/Security Headers. However, it might be that your WordPress installation uses a ‘custom’ file, instead of the standard wp-config.php file as used on a default WordPress installation.

One example of this, is when hosting your WordPress website with the hosting provider “Convesio”. 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 SSL 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 which is located in the same folder as the standard wp-config.php, you can add this snippet in a new .php file, and upload the .php 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 SSL 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.