How to move a group of Files to a new location,
and avoid generating bad links
For example, moving the Rubin archive from /subject/economy/authors to /archive.
- On your own computer copy the entire old archive to the new location, e.g., the /subject/economy/authors/rubin directory to archive/rubin
- You will do a lot of Find and Replace; if you are a PC user, you can install HandyFile File and Replace, a free download from SilverAge.
- Use the HandyFile Find and Replace to remove or add any "../" from href="../../../../../css/", href="../../../../../admin/" and href="../../../../../glossary/" etc., then go in a change all the links to the old index page (e.g. /subject/economy/index.htm) to point to the new location of the archive (e.g. /archive/rubin), and any other links you spot which have been missed.
- Check that they all work by browsing the new pages.
- Copy it across to the server using WinSCP for example.
- Go to the Linkreports and either wait till after the half hour or use the Custom Link check to make sure you’ve done the changes OK.
- Search up the directory tree in the old location to find a .htaccess redirection file, such as /subject/economy/.htaccess and amend it to deal with all the files you’ve moved. You can either copy the format you find in the .htaccess file or read the guide on how to do it. Check that the .htaccess works OK on the server using the old links from the economy index. It's easy top make mistakes here.
- Change all the links to the old location, such as /subject/economy, and update the server.
- Remove the old copies, but you may need assistance for this because it may cause bad links all over the server. eg in the glossary. Check the linkreport for bad links and fix them as soon as possible.