Thread Starter
em920
(@em920)
Hi,
Any advice on this problem?
Thanks
This is a built-in match in Redirection. You don’t need any external check.
When adding the redirect:
1. **Source URL**: pattern matching /careers/(.*) (toggle Regex if you want to catch sub-pages)
2. **URL options** (click *More options* on the source URL row): change *When matched* from URL only to URL and HTTP status code
3. **HTTP status code**: 404
4. **Target URL**: your *Vacancy Closed* page
Now the redirect fires only when the careers URL would otherwise 404. As long as the page exists and returns 200, nothing happens.
A couple of gotchas: Some caching layers (Cloudflare, server-level page cache) keep serving a cached 404 long after the page comes back. If you re-add a vacancy and it still hits the redirect, clear those caches. A few themes return 200 OK on their custom 404 template (for SEO reasons). If yours does that, the match won’t fire, because the actual status code isn’t 404. Quick check: curl -I https://yoursite.com/careers/old-job should return HTTP/1.1 404.
Does your careers page get rebuilt regularly, or is this more of a one-off cleanup? That changes whether you want the redirect to be permanent or scoped to specific URLs.