Nginx to .htaccess Converter – Free Online Config Migration Tool
About This Nginx to .htaccess Converter
Moving from an Nginx server to Apache hosting means rewriting every location block, rewrite rule, and caching directive into a completely different syntax, since .htaccess files follow Apache’s own configuration format. This tool reads through your Nginx configuration and translates the directives it recognizes into working .htaccess rules automatically.
The BigToolSite Team tested this converter against common Nginx configurations covering rewrites, HTTPS redirects, WWW handling, caching, and access restrictions to confirm the generated .htaccess syntax behaves correctly on Apache 2.4 and newer.
Supported patterns include try_files front-controller blocks, rewrite directives, HTTPS and WWW redirect logic, location-based access restrictions, and expires/caching rules for static assets. The output uses modern Apache 2.4+ syntax like Require all denied rather than older deprecated directives, and you can choose to wrap the rewrite rules in an IfModule block for safer deployment on servers where mod_rewrite might not be active.
Migrating in the other direction? Our .htaccess to Nginx converter handles that conversion instead. Once your new .htaccess file is in place, the redirect chain checker can confirm your redirects still resolve correctly after the switch.
How to Use the Nginx to .htaccess Converter
- Paste your existing Nginx configuration into the input box.
- Check “Wrap rewrite rules in IfModule” for safer deployment across different server setups.
- Choose how PHP-related handling should appear in the output.
- Click “Convert to .htaccess” to generate the rules, then copy them or download as a .htaccess file.
Example Usage
Paste in a typical Nginx block containing try_files $uri $uri/ /index.php?$query_string;, and the tool converts it into the equivalent Apache front-controller pattern using RewriteCond %{REQUEST_FILENAME} !-f, !-d, and a RewriteRule pointing to index.php. A block that redirects HTTP to HTTPS using an if ($scheme != "https") check converts into the matching RewriteCond and RewriteRule pair Apache expects.
Yes, it’s completely free with no signup required and no limits on how much configuration you can convert.
It covers the most common patterns, including rewrites, redirects, caching, and access restrictions. Directives like proxy_pass, fastcgi_pass, or custom Nginx variables aren’t supported on Apache and are flagged rather than converted.
Require all denied is the syntax used in Apache 2.4 and newer, which is what most current hosting environments run. Deny from all is the older Apache 2.2 syntax and is deprecated on modern servers.
Yes, most of the generated rules depend on Apache’s mod_rewrite module. Enabling the “Wrap in IfModule” option makes the rules fail safely rather than causing a server error if mod_rewrite isn’t active.
No. Your input is processed to generate the output and is not saved or logged.