0

I have moved wp-config.php but my file structure is as given below:

public_html
--abccom
--applecom
--wp-config.php

abcom and applecom folder has wordpress websites both As advised, I have moved wp-config.php outside abccom for security, but now when I need to do the same for applecom, how can I achieve it?

https://webdesign.tutsplus.com/tutorials/how-to-secure-your-wordpress-wp-configphp--cms-27737

0

1 Answer 1

1

Move wp-config.php to its new location somewhere above "public_html" and add a new "skeleton" wp-config.ph in the WordPress directory e.g.

<?php
include('/dir_above_public_html/priv-applecom/wp-config.php');
?>

The wp-config.php script is included by other WordPress files. So to include this from a non default location we can simply 1. move our "real" wp-config from the Wordpress directory to where we want it located. 2. create a new wp-config in the Wordpress directory that does its own includes of the "real" wp-config script.

The benefits of having this file above public_html/web-root are hotly debated. I am in the camp that wants to avoid having scripts with authentication keys, salts & DB "credentials" in a directory that might be accessed via HTTP(S).

There are no real benefits in moving wp-config to another accessible dir (this may be the case for "abccom" where you have moved it to a dir "public_html" which usually indicates it is yes "public".

Not the answer you're looking for? Browse other questions tagged or ask your own question.