Support » Fixing WordPress » move wp-config file

  • Hi,

    i read on the forms to make it more secure to move the wp-config to a different directory, my web designer is saying its hard to move it or not possible to move it. His comment is “if we will do this then wordpress will not work because this file has some imp. constants for directory structure.”

    is it true? or can i suggest him something about how to move without impacting the directory structure or constants?

Viewing 11 replies - 1 through 11 (of 11 total)
  • It can be done but problem will come every time yo update wordpress your core wp-config.php file will be over written so you will have go in and edit the files.

    If you are so worried about securing your wp-config.php file change the permission on so that no one can edit that file.

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    You can move the wp-config file up one directory from the site-root without an issue. The loader looks in the site root directory and one directory above it for that file.

    You know what something new I learned I just tried it out my test site it does work Thank you Otto

    i am confused. i see a wp-config file in wp-includes and wp-admin is it supposed to have in every directory? i thought its only in the public_html directory?

    well i managed to move it but when i load the site i get below error: 🙁 how did u guys do it?

    There doesn’t seem to be a wp-config.php file. I need this before we can get started. Need more help? We got it. You can create a wp-config.php file through a web interface, but this doesn’t work for all server setups. The safest way is to manually create the file.

    its the one in your root that you move one directory up leave others as is .

    i moved the file to wp-includes

    i get the above error that config file is missing

    You need to move wp-config.php file out of public_html or root in your home where You will see folder public_html,public_ftp and other folders.
    wp-includes is still in public_html that is not one directory up

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    vajjas1: No, *up* a directory. Moving it into wp-includes is *down* a directory.

    Example:
    /username/public_html/wp-config.php
    /username/wp-config.php

    It will check those.

    sk

    (@renegadesk)

    Yep that works nicely, wordpress checks the hosting root directory automatically and it can’t be accessed by www. Nice tip!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘move wp-config file’ is closed to new replies.