Moving to directory creates path problems.. how to solve?

When images are added to WordPress posts and pages, they are stored with the absolute url to the image file on the server. If you change your WordPress installation (move to a different domain, change your folder structure, etc) then you’ll break these images. There are two ways to fix this:

Manually re-write URLs

The most time-consuming path is to sit down and do a find/replace on all image URLs in your site. If you have a large site, this can take forever to do by hand and you’d be well-served writing a script to do it for you. Do a search on the WP support forums and you’ll find a host of pre-written scripts to do just that, but most require a higher level of technical skill or access to your site than most people have.

Use a rewriting plug-in

I’ve moved my blog a few times. It started out as http://eamann.com/wordpress/. Then it moved to http://eamann.com/mindshare/. Then it was http://mindshare.eamann.com. Then it moved to its current home at http://mindsharestrategy.com. Each time, I had the same problem you’re facing now – my images broke.

Rather than manually re-writing my image URLs each time, I installed a redirection plug-in to do it for me. After the first move, if you requested http://eamann.com/wordpress/image1.jpg the server would instead give you http://eamann.com/mindshare/image1.jpg.

You could use a similar redirection script to point all requests to example.com/beta/### to example.com/###. There are several redirection plug-ins available, but this one has a very refined UI and is very easy to use.

tech