htaccess to Nginx converter
Convert Apache .htaccess rules into an equivalent Nginx configuration.
htaccess to Nginx converter
Paste the contents of an Apache .htaccess file and this tool rewrites the rules into the closest equivalent Nginx configuration. It is built for developers moving a site from Apache to Nginx (or setting up a matching Nginx config for local development) who don't want to hand-translate every RewriteRule and RewriteCond line by line.
The options let you turn each rule family on or off independently. RewriteRule and RewriteCond become rewrite directives with an if block for the (single) preceding condition, matching common flags like R=301, L, NC, F and G. Redirect and RedirectMatch become location blocks that return the right status code. ErrorDocument becomes error_page, Header directives become add_header, and ExpiresDefault/ExpiresByType become expires directives on a matching file-extension location. Access control (Order, Deny/Allow, Require) becomes allow/deny, and a complete AuthType Basic block becomes auth_basic plus auth_basic_user_file. You can also wrap the whole result in a server block or a location block, ready to paste into an Nginx config.
Apache and Nginx don't map onto each other one-to-one — a few constructs (multiple ANDed RewriteConds, the OR flag, custom redirect status codes, Header unset, per-mime Expires rules with no matching extension) have no direct Nginx equivalent. When the converter hits one of these it leaves the original line in place as a commented warning instead of guessing, so nothing gets silently dropped or silently wrong; turn warnings off once you've reviewed them if you want a clean file.
Everything runs locally in your browser — your server configuration is never uploaded anywhere, which matters since a .htaccess file can reveal internal paths and access rules. Copy the result, download it as a .txt file, or send it straight to another tool's input to keep refining it.