Nginx ↔ .htaccess Converter
Convert rewrite rules and common directives between nginx and Apache .htaccess — both ways.
About this tool
Paste nginx server/location snippets or an Apache .htaccess file and get an equivalent starting point for the other web server. Handles common redirects, rewrites, try_files/front-controller patterns, headers, deny/allow, Options -Indexes, and ErrorDocument lines.
What you get
- Bidirectional: .htaccess → nginx server block, nginx → RewriteRule/.htaccess
- HTTPS redirects, WordPress-style front controllers, 301/302 return/Redirect
- Header/add_header, deny/allow, autoindex, error pages
- Warnings for rules that need manual review
How to use
Choose direction, paste your config fragment, and copy the result. Always review output before production — complex if blocks, nested locations, and module-specific syntax may need hand-editing.
FAQ
How to convert .htaccess to nginx config?
Choose .htaccess→nginx, paste Apache rules, and copy an equivalent server/location starting point with redirects and rewrites mapped.
Can nginx rewrite rules be converted to Apache?
Yes—paste nginx snippets in nginx→.htaccess mode to get RewriteRule and related directives as a migration draft.
How to migrate Apache redirects to nginx?
Include Redirect and RewriteRule lines; HTTPS redirects and 301/302 patterns map to return or rewrite directives in the output.
Are nginx and htaccess conversions exact?
Common redirects, try_files, headers, and deny/allow rules translate well, but complex if blocks and nested locations need manual review.
By using this tool you agree to our Terms of Use and Privacy Policy. Results are provided as-is without warranty.