.htaccess to Nginx Rewrite Converter

Convert Apache .htaccess rewrite and redirect rules into Nginx configuration syntax.

Apache .htaccess Directives
Embed this tool on your website / blog No code required · Copy and paste
HTML Embed Code (iframe):
<iframe src="https://lucentool.com/htaccess-to-nginx" width="100%" height="650" style="border:1px solid #e5e0d8;border-radius:12px;max-width:850px;width:100%;" frameborder="0"></iframe>
<div style="font-size:12px;color:#78716c;margin-top:6px;font-family:sans-serif;">Powered by <a href="https://lucentool.com/htaccess-to-nginx" target="_blank" style="color:#c85a32;text-decoration:none;">Lucentool - .htaccess to Nginx Rewrite Converter</a></div>

Why Nginx Doesn’t Use .htaccess Files

Apache parses `.htaccess` dynamically on every single HTTP hit by walking directories, incurring disk I/O penalties. Nginx utilizes an event-driven architecture that compiles configuration into memory on startup. This delivers massive throughput but requires all rewrites inside `nginx.conf`.

Syntax Mapping Cheat Sheet