Novence

Blog

301 redirects after you rebuild a site

A 301 says the page has moved for good. On Novence, write the old path, the new path, and 301 in /_redirects, then deploy. Keep the same URL when you can. Redirect only the ones that changed, and test them on the preview host before you move the domain.

By Novence · Published · Updated

When do I need a redirect?

The public URL changed. /2024/05/spring-menu/ became /blog/spring-menu/. A contact page moved from /contact-us/ to /contact/. Someone printed the old address, or Google already indexed it.

A rebuild that keeps every path needs no redirect file. Matching the old paths is the better default. Redirects are the repair for the ones you could not keep.

How do I write the rules?

Create public/_redirects in the site, or _redirects at the root of a plain HTML folder. Deploy it with the other files. Novence reads a Netlify-style subset.

:slug captures one segment. * captures the rest, and :splat pastes it into the new path. Lines starting with # are comments.

Request the old path on the preview URL. A 301 with the right Location header means the rule is live. Then move DNS.

# One rule per line: old path, new path, status
/contact-us/          /contact/            301
/blog/:slug           /writing/:slug       301
/news/*               /blog/:splat         301

What the file cannot do

It cannot redirect a different domain. old.com to new.com is a setting at the registrar or the host that still answers for old.com.

It does not beat a real file. If about/index.html exists, a rule from /about/ never runs.

It is not a rewrite of query strings. Map the path, and keep important query-only pages as real URLs in the new site.

Facts checked 19 October 2026. Sources: Move from WordPress · Submit the site to Google

FAQ

What is the difference between 301 and 302?

301 is permanent, and it is what you want after a rebuild. 302 is temporary. Search engines keep the old URL in the index for a 302.

Do I redirect every page?

Only paths that changed. A page that kept its URL needs no rule. An exact file always wins over a redirect.

Can one rule cover a whole folder?

Yes. /blog/* matches everything under /blog/, and :splat in the destination inserts the rest of the path.

Where do I see if Google accepted them?

Search Console's Pages report, after the domain points at the new site. Give it a couple of weeks.

Publish your site free

One prompt or one command. Your domain and SSL included on Free. No credit card.