.htaccess to Nginx Converter

This tool converts Apache .htaccess rules to Nginx configuration, optimized for use with php-fpm environments

Supported Directives:
Fully converted:
- Options -Indexes: Disables directory listing
- Options +FollowSymLinks: Noted as default in Nginx
- ErrorDocument: Custom error pages
- DirectoryIndex: Default index files
- ExpiresByType: Caching for static files
- AddType: MIME type mappings
- AddCharset: Character set configuration
- AddHandler: Handler mappings (e.g., CGI, PHP)
- SetEnv: Environment variables for FastCGI
- SetEnvIf: Conditional environment variables
- Header: Custom HTTP headers
- AuthType Basic: Enables basic authentication
- AuthName: Sets authentication realm
- AuthUserFile: Specifies authentication file
- Require valid-user: Requires valid user for access
- Files: Exact-match file-specific rules
- FilesMatch: Regex-based file-specific rules
- Location: Exact-match URL-specific rules
- LocationMatch: Regex-based URL-specific rules
- RewriteEngine: Enables rewrite module
- RewriteBase: Base path for rewrites
- RewriteCond: Conditional rewriting (supports -f, -d, -s, -l, -U, regex, comparisons, [OR], [NC])
- RewriteRule: URL rewriting (supports flags: L, R, NC, QSA, NE, E, P, F, G, T)
- RewriteMap: Mapping variables using text files
- Redirect, RedirectMatch: URL redirects
- Deny/Allow: Access control (inside and outside Files/FilesMatch/Location)
- Limit/LimitExcept: Restrict HTTP methods
- CustomLog/AccessLog: Logging configuration
- Alias/AliasMatch: Path aliasing
- mod_deflate/mod_gzip: Compression settings

⚠️ Partially converted (may require manual review):
- RewriteCond with -U (URL existence check, outputs proxy_pass or try_files)
- RewriteCond with -l (symbolic link check, suggests try_files or Lua)
- Complex RewriteCond with chained or nested logic
- RewriteRule with T flag for complex MIME type logic
- RewriteMap with non-text sources (e.g., dbm, prg)
- AddHandler for non-standard handlers

Not converted (manual configuration required):
- php_flag/php_value: PHP settings (use php.ini or FPM config)
- IfModule: Module checks
- Order: Access control order
- AllowOverride: Directory override settings
- Apache-specific authentication (e.g., AuthGroupFile, AuthDigest)
- Other Apache-specific modules or directives
Generated with AI assistance