Redirects
Redirects move a request from one location to another with an HTTP status. You use
them to canonicalize a hostname (apex → www or the reverse), retire old URLs after
a site restructure, and forward parked domains at your real site. managed.dev applies
redirect rules at the edge, before the request reaches WordPress, so they’re fast and
they work even for paths that no longer exist in the app.
Anatomy of a rule
Section titled “Anatomy of a rule”Each rule has three parts:
- source — the incoming hostname and/or path to match, for example
example.comor/old-blog/*. - destination — where to send the request, for example
https://www.example.comor/blog/$1when the source captured a wildcard. - status code —
301for a permanent move (the default; search engines update their index) or302for a temporary one.
Common patterns
Section titled “Common patterns”Apex ↔ www
Section titled “Apex ↔ www”Pick one canonical hostname and forward the other to it. Set the canonical one as your primary domain, then redirect the alternate:
source: example.com/*destination: https://www.example.com/$1status: 301To go the other way (www → apex), just swap the source and destination hostnames.
Legacy URL maps
Section titled “Legacy URL maps”After restructuring a site, forward old paths to their new homes so existing links and search results don’t 404:
source: /products/2023/*destination: /shop/$1status: 301Parked and marketing domains
Section titled “Parked and marketing domains”Forward a secondary domain you own at your main site so it doesn’t sit empty. Attach the domain to the site first (custom domains), then add a rule sending all of its traffic to the primary hostname.
How to manage redirects
Section titled “How to manage redirects”-
Open your site in the dashboard and go to the Redirects tab.
-
Choose Add rule, enter the source pattern and destination, and pick the status code.
-
Save. The rule takes effect at the edge within moments — no deploy required.
You can also manage rules over the API. Redirects live alongside cache settings in the resource model, so they use the cache:write scope:
curl https://api.managed.dev/v1/sites/site_01J7.../redirects \ -H "Authorization: Bearer mfk_live_..." \ -H "Content-Type: application/json" \ -d '{ "source": "example.com/*", "destination": "https://www.example.com/$1", "status": 301 }'mf redirects add \ --site site_01J7... \ --source 'example.com/*' \ --destination 'https://www.example.com/$1' \ --status 301