- Go to http://www.xml-sitemaps.com/ and generating the sitemap from the current (old) site.
- Choose the option to "Download Sitemap in Text Format". It will give you "urllist.txt" with each result on one line.
- Open this file and add the redirects in the following fashion:
old_page.php, /new/page - Convert to SQL by using the following find and replace:
Find: ,
Replace: ', '
Find: \n
Replace: ', {ACCOUNT ID}, NOW(), NOW()),\n\t('
Find: ,
Replace: ', '
Find: \r
Replace: ', {ACCOUNT ID}, NOW(), NOW()),\r\t('
{ACCOUNT ID} should be replaced by the numerical ID of the account.
To the beginning of your text file:
INSERT INTO `redirects` (`match`, `redirect_to`, `account_id`, `created_at`, `updated_at`)
VALUES- Save the file as
redirects.sql. - Run it on your local Typewriter database.
- Test locally before running live.
- Relax!