I followed the guideline from WP Codex.

  • Changed the site url in general settings
  • Copied the .haccess and the index.php files from the subdirectory to the root
  • Edited the root index.php (new copied file in root) from: '/wp-blog-header.php' ); to '/subdirectory/wp-blog-header.php' );
  • checked the permalink structure. the following code is in the new copied root .haccess file

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress}
    

When I navigate the new site my permalinks seem to be working. for example

ruthsabrosa.com/birth-preparation

does not show as

subdirectory.ruthsabrosa.com/birth-preparation

But now the problems:

I need to type in the full old url structure to see the admin bar

http://yogaseowp.ruthsabrosa.com/birth-preparation/

When I edit this page or any other page and try to preview changes I get:

You do not have permission to preview drafts.

Also after I update the post it successfully updates but when I view the post I am directed to my root url which I expected: ruthsabrosa.com/birth-preparation/

However my top admin bar is now gone, also this root directory page is not updated. Only my original page: yogaseowp.ruthsabrosa.com/birth-preparation/ is showing the update and the admin bar.

So when someone uses the sites navigation or lands on the ruthsabrosa.com/birth-preparation/ page from a search they don't see the updated content.

I've been looking at this for several hours and the change made to while logged in to yogaseowp.ruthsabrosa.com/birth-preparation/ seems to eventually appear in the main ruthsabrosa.com/birth-preparation/ page, perhaps it takes about 1 hour for the change to appear.

It's incredibly frustrating to make any changes or updates to the website now as I keep having to manually add the complete url with subdiretory to make changes to any page or post, can't preview any change and I am still not convinced all changes will eventually appear in the root directory pages.

Any guideance would be appreciated.

I'm not sure if you've found a solution yet, but I was in the exact same situation as you. I moved a site into a subdomain but still existing in the root directory as per the codex, changed the permalinks, modified the .htaccess file and ran into the same problems.

To fix this, I just changed my Site Address URL to match the Wordpress Address URL (the subdomain address) and everything started working right. My permalinks were showing the subdomain address, I can preview my changes again, no broken links and my home site was still pointing to the subdomain. Hope this helps!

okay so what you are trying is moving your site from sub directory to root Please follow these steps and do exactly as mentioned for hassle free migration

Step 1 Simply move all your files from Sub-directory to root.

Now you only have to update urls and for this

step 2 Download SRDB Search & Replace Database script and upload it to root. after extracting it rename it, Suppose i'll rename it as SRDB

Step 3

Navigate to http://yoursite.com/SRDB it will open the replace setting, You can put your From(current url) and To(url) links and Dry Run, Once it will show how many links are needed to be updated then you can Live Run, it will Move all the links to /

Final Step:

Update your permalinks from wp-admin. And dont forget to delete that script once you done.

For Safety do backup your database file in case if something goes wrong. Hope this helps :)

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.