A command-line utility to update destination URLs in Netlify _redirects
files using CSV mapping files. Supports both single-site updates and bulk project folder processing via an interactive shell script.
- Updates only exact matches to avoid unintentional changes
- Preserves formatting and untouched lines
- Visual HTML diff report for QA
- Supports per-project folder structure for bulk processing
- Virtual environment setup and dependency installation handled automatically
- Interactive CLI with built-in pre-checks
./run_script.sh
This launches an interactive prompt to choose between:
- Single-site update
- Bulk project update
The script:
- Checks for required files
- Creates a virtual environment (if needed)
- Installs
pandas
- Runs the appropriate updater
/your-folder/
redirects.csv
_redirects
/projects/
/site-a/
redirects.csv
_redirects
/site-b/
redirects.csv
_redirects
Your redirects.csv
must have a header:
old_url,new_url
https://your-site.com/old-path,https://your-site.com/new-path
- Python 3.7+
pandas
(auto-installed when runningrun_script.sh
)- Works best in Unix-like environments (macOS, Linux)
File | Purpose |
---|---|
run_script.sh |
Interactive runner for both modes |
update_netlify_redirects.py |
Single-site updater |
bulk_update_redirects.py |
Bulk folder updater |
requirements.txt |
Python dependency list |
/examples/ |
Sample _redirects and redirects.csv files |
MIT — Eric Rasch
https://github.com/ericrasch/netlify-redirect-updater