PageShift Help

Keep old addresses working (redirects.txt)

How the import keeps your old page addresses, and how a redirects.txt file sends any other old address to the right new page.

When you move to a new website, people and search engines still use the old addresses: in bookmarks, in Google, in links from other sites. A redirect sends them from an old address to the new page automatically, and tells Google the page has moved, so you keep your rankings.

The website import makes most redirects for you. A redirects.txt file in the zip covers the rest.

Redirects the import makes by itself

Each page's address comes from its folder or file name. The import adds a redirect from the file's own address:

File in the zip New address Old address that redirects
index.html / /index.html
about-us/index.html /about-us/ /about-us/index.html
about-us.html /about-us/ /about-us.html

An address typed without the last slash, like /services/roof-replacement, is sent to /services/roof-replacement/ too.

Add other old addresses with redirects.txt

Old addresses that no file name can keep, such as /contact.php or /Our-Team.html, go in a plain text file called redirects.txt, at the top of the zip next to index.html. Whoever builds the import-ready website makes this file; see What an import-ready website is.

Here is the file from the Summit Ridge Roofing sample:

# Old address -> new address (301 unless noted)
/storm-damage.html /storm-damage/
/contact.php /contact/
/Our-Team.html /about-us/
/gallery/* /
/old-blog/* /blog/*

The rules:

  1. One redirect per line: the old address, a space, the new address.
  2. Old addresses start with /. New addresses start with /, or with https:// for another website.
  3. An optional third value is 301 (moved for good, the default) or 302 (moved for now).
  4. Lines starting with # are notes and are ignored.
  5. A * at the end of an old address covers everything under it. /gallery/* / sends every old gallery page to the home page. /old-blog/* /blog/* keeps the rest of the address, so /old-blog/some-post/ goes to /blog/some-post/.
  6. Write each old address exactly as it was, capitals included.

Check the result

After the import, the report shows two lines:

  • "21 old address(es) redirect to the new pages" (all redirects together);
  • "redirects.txt: 5 address(es) added" with an OK badge.

If a line couldn't be used, the report says "not added: line 3" with a Check badge. A line is skipped when:

  • the old address doesn't start with /, or there's no new address;
  • the old address is a page of the new site (PageShift never hides a page that exists).

Fix the file and import again, or add the redirect by hand.

See and change redirects

All redirects, including the imported ones, are listed in SEO → Redirects with how many times each has been used (Hits). There you can add, test, edit or delete a redirect. The SEO and search section explains that screen.

The redirects from the Summit Ridge Roofing import in SEO → Redirects

Written for PageShift 5.99.44. Screens can change a little between versions.