0

So I moved a Wordpress site I've been working on for a client to the client's host, setting up the installation in a subdirectory and planning to set the site address to the domain name once everything is ready to go live.

To make the move, I transferred all the files via FTP, imported the database and changed wp-config to reflect the new database.

But something strange is happening, and I can't figure out how to fix it. The site loads fine. But if I click on, for instance, the "About Us" menu item, I get a 404 error, even though the URL is correct: "http://www.wvhighlands.org/wp/about-us-2/"

BUT, if I manually go in and change the URL to "http://www.wvhighlands.org/wp/wvhighlands/about-us-2/", the page will display, and the URL reverts to the correct one, without the /wvhighlands/.

On the development server, the site was in a directory called "wvhighlands"

The .htaccess file has the Rewrite Engine on, with this setting: RewriteBase /wp/

Any idea what might be going on?

  • wvhighlands.org/wp/about-us-2 loads fine here – RRikesh Mar 15 '16 at 13:21
  • It seems to be sorted out now. I ran the search and replace, reset the permalinks and changed the settings so the site will load from the domain address. I thought I was still having issues, but it appears to have just been a cache problem. I think everything is working as it should now. – Dan Radmacher Mar 15 '16 at 15:29
1

First thing I would do is make sure and go to the Permalinks page and save the permalinks again (I always do this just to make sure).

I would then recommend installing and running this plugin:

https://wordpress.org/plugins/search-and-replace/

Because it sounds like you are using a different URL, and there may be instances of the old URL AND the old PATH in the database.

0

Only an educated guess based on past experience with similar issues, but it sounds like you may not have changed the "WordPress Address (URL)" and "Site Address (URL)" in the General Settings to reflect the new location.

You can set it manually in the wp-config.php:

define( 'WP_SITEURL', 'http://www.wvhighlands.org' );
define( 'WP_HOME', 'http://www.wvhighlands.org' );

But it's almost definitely better to set it in the admin and use the wp-config for overriding in development environments. And this is predicated on assuming you are trying to move the install into the root directory.

More details about using subdirectories for WP setup: https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

  • Thanks. I meant to mention that I had changed the URLs in the General Settings to reflect the new location. – Dan Radmacher Mar 15 '16 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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