0

I'm moving my wp-config.php file outside the wordpress1 root into /folder/

htdocs/folder/wordpress1/wordpress2

Now, how do i approach this for a second wordpress installed in a subfolder inside my root wordpress folder?

If I moved the second wp-config.php file a folder back it would sit in the original wordpress1 root location and cause conflict, yes?

Also having too wp-config.php's in the same location (folder) would cause conflict. Could i re-label a wp-config.php a special way so they don't cause issues?

I'm asking about moving the whole folder because the method were you split half the file and move it to another direction using this script below didn't work:<?php include(‘/folder/config.php’);

Thanks

0

WordPress checks its main docroot for a wp-config file first, and if it's not there, checks its parent directory. The reason you would move it is to take it outside of the publicly accessible docroot. In your case in the wordpress2 folder, moving it up just one directory doesn't have any benefit, since it is still accessible, not to mention that it would create conflicts with the wordpress1 install.

If you really wanted to move them out of the docroot, I'd suggest putting both config files up into your htdocs/folder/ directory with different names, and then as you mentioned, use an include() to access it.

In your example, include(‘/folder/config.php’); make sure your paths are relative, or specified right from the root folder, so your wp-config would either be:

include('../wordpress1-config.php');  // for the wp1 site
include('../../wordpress2-config.php');  // for the wp2 site

or

include('/home/user/htdocs/wordpress1-config.php');  // for the wp1 site
include('/home/user/htdocs/wordpress2-config.php');  // for the wp2 site
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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