WordPress.org

Forums

Moving WordPress outside public_html (4 posts)

  1. roiabrazaldo
    Member
    Posted 1 year ago #

    I've been running wordpress smoothly for months now with regular installation.

    Now for security reasons I wanted to move my wordpress directory OUTSIDE the public_html folder.

    I have read the "moving your wp-config outside" and yes its pretty ok IF you only have 1 wordpress install in your website.

    In my case I got hosting and currently hosting 5 wordpress website which i made myself.

    my current directory is

    /public_html/site1/
    /public_html/site2/
    /public_html/site3/
    /public_html/site4/
    /public_html/site5/

    what i wanted is

    those folder should only have index.php

    /public_html/site1/index.php
    /public_html/site2/index.php
    /public_html/site3/index.php
    /public_html/site4/index.php
    /public_html/site5/index.php

    and the wordpress files should be outside public_html and in

    /wordpress/site1
    /wordpress/site2
    /wordpress/site3
    /wordpress/site4
    /wordpress/site5

    OR atleast the wp-config file

    /wordpress/site1/wp-config.php
    /wordpress/site2/wp-config.php
    /wordpress/site3/wp-config.php
    /wordpress/site4/wp-config.php
    /wordpress/site5/wp-config.php

    please help!

    should it be done via HTACCESS? or any? i have no clue

  2. roiabrazaldo
    Member
    Posted 1 year ago #

    ok i manage to do it with the wp-config.php alone

    I just move it outside the public_html and in

    /wordpress/site1/wp-config.php

    and created a new wp-config.php in

    /public_html/site1/wp-config.php

    with the content of

    <?php
    include( '../../wordpress/sample1/wp-config.php');
    ?>

    is it secure enought?

  3. roiabrazaldo
    Member
    Posted 1 year ago #

    oops its not right..
    im having problem accessing wp-admin..

    is there anyone care to share any knowledge about this?

  4. roiabrazaldo
    Member
    Posted 1 year ago #

    fixed it wordpress cant accept this

    <?php
    include( '../../wordpress/sample1/wp-config.php');
    ?>

    it needs to be

    <?php
    include( '/home/username/wordpress/sample1/wp-config.php');
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.