[resolved] Can't move WordPress installation from /blog/ to root (10 posts)

  1. Rafael Fischmann
    Posted 6 years ago #


    I've done all I could, but I can't figure this one out. I've moved WordPress installations heaps of times before, but this one is really tricking me and I don't know what to do.

    I'm trying to move http://macmagazine.uol.com.br/blog/ to http://macmagazine.uol.com.br/. What I did:

    1 - Disabled all my plugins.
    2 - Went to the General settings and changed the WordPress address and site url from http://macmagazine.uol.com.br/blog to http://macmagazine.uol.com.br
    3 - Moved all the files to the root folder. Then, I can't even access the admin anymore, it keeps the /blog/ reference somewhere. Here's the error:

    Warning: require_once(/home/macmagaz/public_html/blog/wp-load.php) [function.require-once]: failed to open stream: No such file or directory in /home/macmagaz/public_html/blog/wp-blog-header.php on line 12
    Fatal error: require_once() [function.require]: Failed opening required '/home/macmagaz/public_html/blog/wp-load.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/macmagaz/public_html/blog/wp-blog-header.php on line 12

    The same thing happens if I first move the files and then manually edit siteurl and home in the wp_options table inside phpMyAdmin.

    Is there anywhere else WordPress might be pulling this information from?! I'm desperate here.

  2. Check for paths in your wp-config.php file - a setting there can over-ride what's in the database.

  3. Rafael Fischmann
    Posted 6 years ago #

    There are no paths defined in wp-config.php, I use the default pattern for the file. The only reference I see there is this, and it doesn't have any reference to /blog/:

    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
  4. Rafael Fischmann
    Posted 6 years ago #

    Anyone? :(

  5. whooami
    Posted 6 years ago #

    whats in your .htaccess?

  6. Rafael Fischmann
    Posted 6 years ago #

    Currently, this:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php [L]
    # END WordPress
    # protect wpconfig.php
    <files wp-config.php>
    Order deny,allow
    deny from all

    However, I tried maintaining it, renaming it to something like .htaccessOLD and even deleting it. I don't think the .htaccess is responsible for this. :(

  7. whooami
    Posted 6 years ago #

  8. Rafael Fischmann
    Posted 6 years ago #

    @whooami, I can't read your last message here, it's empty, weird. :(

  9. Rafael Fischmann
    Posted 6 years ago #

    Just so you guys know, I've done everything I could, tried it all again and got the same problem. Then I decided to reboot my whole server... it worked! ;) Thank God. I have no idea why this happened.

  10. joetheboss
    Posted 6 years ago #

    If you have tried to move your blog to another directory by following the guidelines on http://codex.wordpress.org/Moving_WordPress, and encounter the error stated above, there may be a solution for you.

    Instead of moving the wordpress files/directories from the old location to the new location, you should upload the files/directories (exclude the upload directory for attachment) to the new location.

    I guess that the reason is that this PHP command: dirname(__FILE__) will return the old path even the file is moved to a new location. So every scripts that use this command will have problems.

    If you have the rights to reboot the web server, the problem will be solved as well.

Topic Closed

This topic has been closed to new replies.

About this Topic