Keep your old links working
A redirect sends anyone opening an old address to the new one. You need them in two situations:
- You moved your site to Bailey from somewhere else, and your pages don’t have the same addresses any more.
- You reorganised your own site —
/newsbecame/blog, or you added a language prefix like/fr/.
Without redirects, every one of those old addresses shows a “page not found”. That includes bookmarks, links shared in messages, and — the expensive one — the results Google has been sending you for months.
Coming from Netlify, Vercel or Cloudflare?
Section titled “Coming from Netlify, Vercel or Cloudflare?”Those hosts keep redirects in a file called _redirects inside your folder. Bailey doesn’t read that file — it has its own way of doing it, described below.
The good news: Bailey tells you when it spots one, instead of publishing your site as if nothing were missing. You’ll see a line like this when you publish:
⚠ _redirects found (26 rules) — not applied by Bailey. → run `bailey deploy … --import-redirects` to bring them over.If you use the command line, that flag translates your existing rules into Bailey’s own format and saves them with your site:
bailey deploy dist --app mysite --import-redirectsIt reports exactly what it took over and what it couldn’t, line by line — nothing is dropped quietly. You only need the flag once: the rules are stored with your site and stay there when you publish again.
Writing redirects yourself
Section titled “Writing redirects yourself”Redirects live in a file named recon.manifest.json, at the top of the folder you publish. The same file is where you’d declare data collection, so you may already have one.
-
Create (or open)
recon.manifest.jsonin your folder. -
Add a
redirectslist — each entry has afromand ato:{"redirects": [{ "from": "/manifesto", "to": "/en/manifesto" },{ "from": "/news/*", "to": "/blog/:splat" },{ "from": "/old-offer", "to": "/pricing", "status": 302 }]} -
Publish your folder as usual. The rules take effect immediately.
What the pieces mean:
| Piece | What it does |
|---|---|
from | The old address, starting with /. |
to | Where visitors should land. |
* and :splat | A whole section at once: /news/* → /blog/:splat sends /news/hello to /blog/hello. |
status | 301 (default) means “moved for good” — that’s what tells Google to transfer your ranking. Use 302 only for something temporary. |
What Bailey won’t do
Section titled “What Bailey won’t do”Some rules from other hosts have no equivalent here. When you import, each one is listed with the reason:
| Rule | Why not |
|---|---|
Rewrites (status 200) | The address stays put while another page’s content is served. It makes broken links look like working pages to search engines. If you were using /* → /index.html for a web app, declare it as an app instead — Bailey supports that properly. |
Proxying to another server (/api/* → https://…) | Bailey serves your files and your governed data. Forwarding visitor traffic to another server would send data out through a door Bailey can’t see — the exact thing it exists to prevent. |
| Rules by country, language or role | Not supported. |
http:// targets | Bailey redirects over https:// only. |
Two addresses for one page
Section titled “Two addresses for one page”/about and /about/ used to both work, which quietly counted as two pages with identical content for search engines. Bailey now picks one and redirects the other.
You don’t have to do anything, and it follows your own folder: if the page comes from about/index.html — a folder — the address with the trailing slash is the real one. Pages that are plain files, like /about.html, are left exactly as they are.
What Bailey already does for you
Section titled “What Bailey already does for you”None of this needs setting up. It’s simply how your site is served.
- Your site loads fast on the second visit. Files whose name contains their own version (
index-HUQ9Qg3Q.js— most modern tools produce these) are stored by the browser for a year, because a change to them changes their name. Your pages themselves stay fresh, so a new publication shows up within a minute. - Your images can appear full-size in search results. Search engines only show large image previews — and only consider a page for Google Discover — if the site says it’s allowed. Bailey says it, for every public site. A page that asks not to be indexed still isn’t: your instruction always wins.
- Your visitors’ connection stays encrypted, and your addresses aren’t leaked to the sites you link to.