Support » Fixing WordPress » Can’t move WordPress installation from /blog/ to root

  • Resolved Rafael Fischmann

    (@rfischmann)


    Guys,

    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.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Check for paths in your wp-config.php file – a setting there can over-ride what’s in the database.

    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__) . '/');

    Anyone? 🙁

    whooami

    (@whooami)

    Member

    whats in your .htaccess?

    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]
    </IfModule>
    
    # END WordPress
    
    # protect wpconfig.php
    <files wp-config.php>
    Order deny,allow
    deny from all
    </files>

    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. 🙁

    whooami

    (@whooami)

    Member

    @whooami, I can’t read your last message here, it’s empty, weird. 🙁

    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.

    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.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Can’t move WordPress installation from /blog/ to root’ is closed to new replies.