Why the original URLs must not change when you rebuild an expired domain
When you rebuild a website on an expired domain, it is tempting to tidy the URLs: /about.php becomes /about/, /index.php?page=contact becomes /contact/, and redirects send the old addresses to the new ones. Don't.
Links point at exact addresses
The value of an expired domain is in the links other websites made to it over the years. Each of those links points at one exact URL. Search engines follow that URL. If it answers with the page, the link counts. If it answers with a redirect, some of the value can be lost along the way and the old URL may drop out of the index. If it answers with a 404, the link counts for nothing.
So every URL that existed should answer with its page at the same address.
The hard cases
Apache and nginx serve /about/ and /about.html without any help (Cloudflare Pages does not: it redirects /about.html to /about). Old sites have other shapes too:
| Original URL | Problem on static hosting |
|---|---|
/about.php |
The file is HTML now, but it still needs the .php name |
/index.php?page=contact |
A static file cannot depend on the query string |
/blog/2019/05/rye-bread |
No extension and no slash, so the server does not know it is a page |
/thumb.php?id=3 |
An image served by a script |
How to keep them
.phppages keep their file name and contain plain HTML. A PHP server prints such a file unchanged. Other servers are told to send it astext/html.- Query-string URLs are stored as files under another name, and an internal rewrite rule serves them at the original address. In Apache that is a
RewriteRulewith aRewriteCondon the query string. In nginx it is amapon$request_uri. The browser and Google still see/index.php?page=contact. - Extensionless URLs are stored as
rye-bread.htmland served at/blog/2019/05/rye-breadby a rule that tries.htmlbefore giving up. No slash is added. - Script-served images are stored with a proper extension and served at the original URL by a rewrite.
Redirects: only the original ones
Some URLs did redirect on the original site. For example, /old-page.html sent visitors to /about.php with a 301. The archive records those redirects, and they should come back exactly as they were. Every other URL answers with its page.
Check before you go live
Take the URLs with the most backlinks from your SEO tool and open each one on the new site. Each should return 200 with the right page, unless the original site redirected it.