Built by Artur Ferreira for thegeolab.net — where we manage 12+ Nginx redirects across a growing content architecture.
Manage Nginx 301 redirects safely — add, list, verify, or remove.
Replaces ad-hoc sed/python editing of Nginx configs with a structured command:
- Add: Creates regex-based redirects that handle trailing slash variation
- List: Shows all active redirects from the Nginx config
- Verify: Tests every redirect returns 301
- Remove: Safely removes a redirect without breaking the config
cp redirect.md ~/.claude/commands/redirect.md/redirect add /old-slug /new-slug
/redirect list
/redirect verify
/redirect remove /old-slug
Always uses regex to handle trailing slash:
location ~ ^/old-slug/?$ { return 301 /new-slug/; }Never uses exact match (location =) — it fails on trailing slash mismatch.
- Always runs
nginx -tbefore reloading - Uses
systemctl reload(not restart) for zero downtime - Verifies both
/slugand/slug/after adding - Checks for redirect chains and consolidates
- SSH access to VPS with Nginx
- Nginx config at a known path
A project by The GEO Lab — Generative Engine Optimisation research