🔁 htaccess 转 Nginx 规则htaccess to Nginx Converter
把 Apache .htaccess 的 RewriteRule / Redirect 伪静态规则转换为 Nginx rewrite 配置(尽力转换,复杂规则需人工复核)。Convert Apache .htaccess RewriteRule / Redirect rules into Nginx rewrite config (best-effort; review complex rules).
使用说明与常见问题How-to & FAQ
「htaccess 转 Nginx 规则」是什么?What is the htaccess to Nginx Converter tool?
把 Apache .htaccess 的 RewriteRule / Redirect 伪静态规则转换为 Nginx rewrite 配置(尽力转换,复杂规则需人工复核)。Convert Apache .htaccess RewriteRule / Redirect rules into Nginx rewrite config (best-effort; review complex rules).
如何使用「htaccess 转 Nginx 规则」?How do I use the htaccess to Nginx Converter tool?
在「htaccess 转 Nginx 规则」中,把内容粘贴或输入到上方输入框,结果会实时显示在下方,点击「复制结果」即可复制。In the htaccess to Nginx Converter: Paste or type into the input box; the result appears below instantly — click "Copy result" to copy it.
转换结果能直接用吗?Can I use the output directly?
这是尽力转换的结果,适合作为起点。复杂的 RewriteCond 组合、环境变量和 .htaccess 特有指令需要手动核对,并放入对应的 server/location 块中。It is a best-effort starting point. Complex RewriteCond combinations, environment variables and .htaccess-specific directives need manual review, placed in the right server/location block.
文件存在判断(!-f / !-d)怎么转换?How are file checks (!-f / !-d) converted?
典型的“文件不存在就交给 index.php”规则会转换为 try_files $uri $uri/ /index.php?$args;带反向引用的规则会转换为 if (!-e $request_filename) { rewrite … }。Nginx 的 if 不支持多个条件同时成立,遇到时会给出注释提示。The common front-controller rule becomes try_files $uri $uri/ /index.php?$args; rules with back-references become if (!-e $request_filename) { rewrite … }. Nginx if cannot AND several conditions, so those are flagged with a comment.
代码或数据会被上传吗?Is my code or data uploaded?
不会。「htaccess 转 Nginx 规则」完全用 JavaScript 在本地运行,适合处理含有密钥、内部接口等敏感内容的数据。No. The htaccess to Nginx Converter runs entirely in local JavaScript, so it is safe for data containing keys or internal endpoints.
「htaccess 转 Nginx 规则」免费吗?需要注册吗?Is the htaccess to Nginx Converter free? Do I need an account?
「htaccess 转 Nginx 规则」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The htaccess to Nginx Converter is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.