Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I know there's a ton of posts pertaining to broken links after migrating a wordpress installation, but I haven't been able to find an exact solution to this one.

A site I'm working on has the production wordpress installation running woocommerce running in the root (public_html) directory. That's working fine. I also have a second installation, which we use for different testing and development, in the root/dev directory.

The /dev directory is where I did all of the initial development, and I migrated those same files and a copy of the database out to the root directory to "launch" the site in the next couple weeks. Now we had to add a Rewrite rule to the .htaccess in the root directory to force an HTTPS URL. We added the following lines:

RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://eddiessportstreasures.com/$1 [R,L]

The dev site resides in eddiessportstreasures.com/dev, which is username/password protected. The WP URL and Site URL are both set to eddiessportstreasures.com/dev in the admin dashboard. The admin dashboard is working perfectly fine, and all of the woocommerce links are completely fine. It's just that whenever I hover over a link in my custom menu it now shows a link to the page on the production installation - eddiessportstreasures.com/.

So, for example, a link to "Baseball Cards" in the custom menu, where the page address is set to "/product-category/cards/baseball-cards", takes me to eddiessportstreasures.com/product-category/cards/baseball-cards instead of eddiessportstreasures.com/**dev/**product-category/cards/baseball-cards. This of course, brings about a 404 error.

This is the same for any "hard-coded" links I have - i.e. the custom menu, and a couple other links to pages within the site. Now, I could go through and change all of the link addresses to include "/dev/", but that's over 50 URLs, and it's not a real solution.

For the record, I also reset permalinks.

Any help would be greatly appreciated.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.