We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
Was this tool helpful to use?
Your feedback helps us make it better
Quickly convert Apache .htaccess rewrite rules, redirects, and access control directives into Nginx config for smooth website migration.
Draft for selected root .htaccess directives. RewriteCond, Redirect, Header and unsupported flags stay explicit TODOs. Check context, syntax and behavior before replacing any production config. Reference
Your configuration is converted locally in your browser and never uploaded. Supports common rewrite, redirect, error page, directory index, and response header directives.
Enter an .htaccess configuration to generate the Nginx configuration here in real time
Overview
Understand what the tool solves, how it works, and the boundaries of its data.
Apache .htaccess rules run in a directory context, where the directory prefix is removed before a rewrite pattern is matched. Nginx configuration is organized around server and location contexts instead. A line-by-line text conversion therefore cannot infer every directory, host, filesystem, or application detail needed for a complete migration.
Paste rules to receive a suggested Nginx text draft. The converter recognizes selected RewriteCond variables (host, URI, HTTPS, method, and query string), RewriteRule patterns and common redirect flags, simple Redirect lines, DirectoryIndex, index-listing options, ErrorDocument, and a basic set-header form. Recognized directives are converted; other lines are kept as TODO comments with warnings.
For example, DirectoryIndex index.php maps to an Nginx index directive, while unsupported directives remain for manual review. Nginx’s own migration guide warns that a seemingly direct rewrite can be cumbersome or ineffective when a redirect should instead be handled with a separate server block.
Technical references
.htaccess context affects matching and RewriteBase; checked September 29, 2026.Guide
Follow the workflow and verify inputs and outputs with practical examples.
Paste the relevant .htaccess lines into the input area. Comments and blank lines can remain in place; an example is available if you want to see the output shape.
Read the generated text and warning list together. A TODO comment means a line was not converted and needs an intentional replacement, removal, or explanation.
Check each rule against its original directory context, URL path, host condition, and query-string behavior. In particular, confirm whether the output belongs at server level or inside a matching location.
Copy only the reviewed directives into an appropriate test configuration, run Nginx’s configuration check, and exercise representative requests before using the change on a live site.
Do not judge completeness by the number of output lines: some input lines are comments or no-op settings, and some recognized syntax still needs surrounding server configuration.
Use cases
See how the tool fits into real work and everyday tasks.
An administrator can inventory common redirects and index settings before moving a site, then use TODO warnings to identify rules that need a deliberate Nginx design.
A developer can compare a short redirect or error-page rule with the proposed directive during a code review. The reviewer still checks the application’s routing and deployment context.
Q&A
Find concise answers to common questions and confusing cases.
No. It handles selected rewrite conditions and rules plus several common directives. Unsupported lines are reported as TODOs; directives from other Apache modules need a separate Nginx design.
The converter only translates recognized patterns. A comment preserves the source line as a reminder that the behavior has not been mapped; it is not an active Nginx directive.
No. Server and location context affects meaning, and Nginx does not reproduce Apache’s per-directory inheritance model. Place each rule in the context that matches your host and paths.
Notes
Review scope, result limitations, and important precautions before use.
A syntactically plausible rule is not proof of equivalent request behavior. Apache’s directory-relative matching, rewrite flags, inherited rules, and environment variables can differ from Nginx’s contexts and variables. Query strings, redirect status, path prefixes, and rewrite loops deserve particular attention. Keep the original configuration, test representative requests on a non-production server, and review Nginx error logs before deploying.
Related
Discover related tools, collections, and available API capabilities.