● runs entirely in your browser

.htaccess to Nginx Converter

Paste an Apache .htaccess file to get the equivalent Nginx config for the directives that translate directly. Nothing is ever uploaded.

⚠ Covers the common directives: RewriteRule (simple, single-rule patterns), Redirect/RedirectMatch, ErrorDocument, DirectoryIndex, and legacy Allow/Deny. Complex chained RewriteCond logic and module-specific directives aren't 1:1 translatable and are flagged, not guessed at.

How it works

The converter reads the .htaccess file line by line and matches each one against regex patterns for the directives that translate cleanly: RewriteRule (mapping the R=301/R=302 flags to Nginx's permanent/redirect and the L flag to last), Redirect and RedirectMatch (turned into location blocks with a return), ErrorDocument, DirectoryIndex, Allow/Deny from all, and AddType. Any line that doesn't match one of those patterns is collected into an unconverted list and shown as a warning rather than being guessed at.

FAQ

Why do some lines get flagged as "not recognized" instead of converted?
Apache and Nginx directives don't all map one-to-one — chained RewriteCond logic and module-specific directives in particular have no reliable automatic translation, so the converter flags them for manual review instead of producing a guess that might be wrong.
What does the [L] flag turn into in the Nginx output?
It becomes the last flag on the rewrite directive, which tells Nginx to stop evaluating further rewrite rules in that block — the closest available equivalent to Apache's "last rule" behavior.

Free, unlimited, no account. If this saved you a paid tool, a small thanks is appreciated.

Say thanks — $3