Free Redirect Map Compiler for Nginx, Apache & Next.js

Site migrations with hundreds of changed URLs break when redirects are typed by hand — one typo means 404s and lost rankings. The free redirect map compiler on ToolMars converts a list of old/new path pairs into Nginx map blocks, Apache RewriteMaps, or Next.js redirect arrays. All processing stays in your browser.
301 redirects tell search engines where content moved and pass link equity to the new URL. At scale, map-based lookups beat long chains of rewrite rules on both performance and maintainability.
Compile bulk 301 redirects for any platform
Free redirect compiler — Nginx map, Apache RewriteMap, Next.js config, runs locally.
Why Map-Based Redirects Scale
Nginx evaluates rewrite rules sequentially — O(N) per request. A map directive builds a hash table for O(1) lookups. On high-traffic sites with thousands of legacy paths, that difference matters for CPU and latency.
How to Compile Your Redirect Map
Step-by-step
- Open the redirect compiler.
- Paste old/new URL pairs — one per line, tab or comma separated.
- Select Nginx Map, Apache RewriteMap, or Next.js config.
- Choose 301 (permanent) or 302 (temporary).
- Copy the output and test in staging before production deploy.
Platform Output Examples
Nginx map
http {
map $uri $redirect_uri {
default "";
/legacy-about /about;
/old-contact /contact;
}
server {
if ($redirect_uri != "") { return 301 $redirect_uri; }
}
}Next.js redirects
// next.config.js
module.exports = {
async redirects() {
return [
{ source: '/legacy-about', destination: '/about', permanent: true },
];
},
};Validate JSON Before Deploy
Next.js redirect arrays must be valid JSON — one trailing comma breaks the build. Paste output into the JSON parser to catch syntax errors. Clean new paths with the slug generator. See our JSON formatting guide for secure local validation.
Conclusion
Bulk migrations need bulk tooling. Paste your path pairs, pick your platform, test in staging, deploy — and keep thousands of 301s maintainable without hand-typing rewrite syntax.
Compile bulk 301 redirects for any platform
Free redirect compiler — Nginx map, Apache RewriteMap, Next.js config, runs locally.
Frequently Asked Questions
Nginx map vs rewrite rules?
Maps use hash lookups — much faster for large redirect lists.
Is my data stored?
No — compilation runs entirely in your browser.
Relative or absolute URLs?
Relative for same domain; absolute when changing domains.
301 or 302?
301 for permanent SEO migrations; 302 for temporary moves.
Regex support?
Exact path mapping only — regex needs custom server config.
Avoiding redirect loops?
Never map a destination URL back to itself; test in staging first.