WordPress.org

Ready to get started?Download WordPress

Forums

Error establishing a database connection - WordPress Multistage in Sub-Folder (2 posts)

  1. dompl
    Member
    Posted 2 months ago #

    Hi all.

    I have a website running on my production server which I moved to localhost.

    The folder structure is as follow:

    localhost/xxx/main - Here are the website files.

    I have updates the database by changing all the url's to be localhost/xxx/main.

    My .htaccess looks like this :

    RewriteEngine On
    RewriteBase /xxx/main/
    RewriteRule ^index\.php$ - [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    wp-config.php has the following lines added :

    /* Multisite */
    define('WP_ALLOW_MULTISITE', true);
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'localhost');
    define('PATH_CURRENT_SITE', '/xxx/main/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    /* That's all, stop editing! Happy blogging. */

    The problem I am having now is that I cant establish the connection to the database.

    Whenever I set up
    define('MULTISITE', false);
    the connection with the database is being established just fine.

    Any ideas please?

    Thanks

    Dom

  2. Uninstall multisite: http://wpmututorials.com/how-to/how-to-disable-multisite/

    Then start over and make sure you don't add ALL the wp-config lines at once.

Reply

You must log in to post.

About this Topic