How to Change a Page's URL Without Losing Google Traffic
Rename a page with a short, hyphenated URL, add a permanent redirect on Netlify, Vercel, Cloudflare or GitHub Pages, then update links and your sitemap.
By Paul Peery
· 7 min read

To change a page's URL safely, pick the new address (short, lowercase, words separated by hyphens), publish the page there, and make the old address send a permanent redirect (301 or 308) to the new one. Then update your own links and your sitemap so they point straight at the new URL, and keep the redirect for at least a year. Google moves the page's place in search results to the new address, and anyone with an old bookmark or a link from another site still lands in the right place. On a static host it's one line in a redirects file and about 20 minutes of work.
Why this is worth doing now#
On Oct 23, 2026 Google updated its guidance on crawlable URL structures
to spell out when to use hyphens and when to use underscores. The page recommends hyphens (-) to separate
words, because underscores are often used in programming to join words together, while a hyphen clearly marks a
word boundary. It also says Google treats URLs as case sensitive: /APPLE and /apple are two different
addresses.
That's a good prompt to look at your own addresses. Typical ones worth fixing on a small-business site:
- Generic names from a template, such as
/serviceor/page-2, when/boiler-repairsays what the page is about. - Underscores or joined-up words, such as
/gift_vouchersor/giftvouchers. - Mixed case, such as
/Menu, which some hosts serve as a separate page from/menu. - Pages that changed purpose, like a "summer menu" page that's now the menu all year round.
Don't rename pages that are fine just to tidy up. Every change costs a little: a redirect hop for visitors and a short period while Google catches up. Change a URL when the new one is clearly better, and do several at once rather than one a week.
Step 1: choose the new URL#
Google's URL guide recommends a simple structure with readable words in the language your customers search in. In practice:
- Lowercase only, so there's one version of each address.
- Hyphens between words:
/wedding-cakes, not/wedding_cakesor/weddingcakes. - Short and descriptive: the service or product, not a sentence.
/emergency-plumbingbeats/our-24-hour-emergency-plumbing-services-in-town. - No dates or years unless the page really is about one date, so you never need to rename it again. A Black Friday page on a reusable address is covered in How to Set Up a Black Friday Sale.
- Avoid accented letters if you can. If you need them, Google's guide says to percent-encode them in
links (
gem%C3%BCserather thangemüse).
Step 2: move the page#
How you rename the page depends on your stack.
- HTML templates: rename the file, for example
service.htmltoboiler-repair.html. Every page has its own copy of the header and footer, so search all the.htmlfiles for the old file name and update each link (most code editors have a "find in files" for this). - Next.js templates: rename the route folder in
src/app, for examplesrc/app/service/tosrc/app/boiler-repair/, then search the project for the old path and update the links. - Astro templates: rename the file in
src/pages, for exampleservice.astrotoboiler-repair.astro, and update the links the same way. - WordPress: edit the page, open the page settings panel and change its slug. WordPress remembers old slugs and redirects them for posts, but the function skips hierarchical post types, which includes pages. For a renamed page, add a redirect with a redirect plugin or your host's redirect settings.
Check the customizing guide if you haven't edited a template's pages before.
Step 3: add a permanent redirect#
A redirect tells browsers and Google that the old address has moved. Google's redirects guide explains why the type matters: with a permanent redirect, Google shows the new address in search results and treats it as the page's main (canonical) URL. With a temporary one (302 or 307), it keeps showing the old address. So for a rename you want 301 or 308.
The setup is different on each host. All the examples below send /service to /boiler-repair. Use the new
address exactly as your own links and sitemap write it: if your HTML links keep the extension, the destination
is /boiler-repair.html.
Netlify#
Create a plain text file called _redirects (no extension) in the folder you deploy. Netlify's
redirects docs say each rule goes on its own
line, old path first, and that the status is 301 if you leave it out. Writing it out does no harm:
/service /boiler-repair 301
/service.html /boiler-repair 301Rules are read top to bottom and the first match wins. Paths are case-sensitive, so add a line for /Service
too if that version was ever linked. If a file still exists at the old path, Netlify serves the file instead of
redirecting; delete it, or force the rule
by adding ! after the status code (301!).
Cloudflare (Workers and Pages)#
Cloudflare reads the same _redirects file, but its default status code is 302,
a temporary redirect. Always add 301 at the end of each line:
/service /boiler-repair 301
/service.html /boiler-repair 301At the time of writing a _redirects file can hold 2,000 static redirects and 100 dynamic ones (with
wildcards), far more than a small site needs. If you're still on Pages, the same file keeps working after
moving to Workers.
Vercel#
Add a redirects list to vercel.json in the project root. In the
vercel.json reference, permanent: true
sends a 308 (permanent) and permanent: false a 307 (temporary):
{
"redirects": [
{ "source": "/service", "destination": "/boiler-repair", "permanent": true },
{ "source": "/service.html", "destination": "/boiler-repair", "permanent": true }
]
}Vercel's limits at the time of writing are 2,048 redirects in the list.
GitHub Pages#
GitHub Pages serves files as they are and has no redirects file. The fallback Google supports is an
instant meta refresh: its redirects guide says Google treats a meta refresh with a 0-second delay as a
permanent redirect (a delay of more than 0 seconds counts as temporary). Keep a small page at the old address,
for example service.html, containing only this:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>This page has moved</title>
<meta http-equiv="refresh" content="0; url=https://www.example.com/boiler-repair" />
<link rel="canonical" href="https://www.example.com/boiler-repair" />
</head>
<body>
<p>This page has moved to <a href="/boiler-repair">Boiler repair</a>.</p>
</body>
</html>Replace www.example.com with your own domain. The visible link helps anyone whose browser blocks the
refresh.
A note for Next.js and Astro#
The Freeframe Next.js templates build a static export,
and redirects in next.config are on that page's list of unsupported features. Use the host's own redirects
instead: put _redirects in the public/ folder so the build copies it into out/, or use vercel.json on
Vercel.
Astro has a redirects option in
astro.config.mjs, but for a static build it writes meta refresh pages and, as its docs put it, the status
code "is not used by the server". That works for Google, but a real 301 from the host is better, so on
Netlify, Cloudflare or Vercel prefer the host's file, again from public/.
Step 4: update links, sitemap and profiles#
A redirect catches old links, but every hop slows visitors down a little. Google's guide to moving pages recommends changing your own links to point at the new URL. Work through:
- Your own pages: the header, footer and any links in the text (step 2).
- Your sitemap: replace the old URL in
sitemap.xml(or let Next.js or Astro regenerate it), then resubmit it in Search Console under Sitemaps. The SEO docs explain where the sitemap lives in each stack. - Places you control outside the site: your Google Business Profile, social media bios, email signatures, booking platforms and directory listings.
- Your best inbound links: if a local paper or supplier links to the old page, ask them to update it.
Step 5: test it and keep it#
Open the old address in a private window and check you land on the new page. To see the status code, run this in a terminal:
curl -sI https://www.example.com/serviceThe first line should say 301 or 308, and the location: line should show the new address. A 302 or
307 means the redirect is temporary: on Cloudflare, add 301 to the rule; on Vercel, set
permanent: true.
Then use the URL Inspection tool in Search Console on the new URL and choose Request indexing, so Google visits it sooner. For the following weeks, the Performance report should show the new URL picking up the impressions the old one had.
Finally, leave the redirect in place. Google's site-move guide says to keep redirects "for as long as
possible, generally at least 1 year", and from the visitors' side to consider keeping them indefinitely. A
line in _redirects costs nothing, so there's rarely a reason to remove it.
Quick checklist#
- The new URL is lowercase, short and uses hyphens.
- The page is live at the new address and the old file is gone (or the rule is forced).
- The old address returns 301 or 308, not 302 or 307.
- Your navigation, footer and in-text links use the new URL.
- The sitemap lists the new URL and has been resubmitted.
- Your Google Business Profile and social profiles link to the new URL.
- The redirect stays for at least a year.
Renaming a service page is also a good moment to check the page itself is ready for search: the launch checklist covers titles, descriptions and the rest. Templates like Handy and Bistro keep each service or menu on its own page, so a clear address for each one is easy to set up from the start.

About the author
Paul Peery
Founder of Freeframe
Paul Peery runs Freeframe, which publishes complete multi-page website templates in HTML, Next.js, Astro and WordPress, and writes about getting small websites built, launched and kept up to date.


