更改 Apache .htaccess 文件以与 Nginx 一起使用 [英] Change Apache .htaccess file to be used with Nginx
问题描述
我正在将网站从具有 Apache 网络服务器的服务器迁移到另一台运行 Nginx 网络服务器的服务器,并且我想转换 .htaccess 文件,问题不仅在于语法,还在于文件名称,它也是 ".htaccess" 还是什么?
I'm migrating a website from a server that has Apache web-server to another server that is running Nginx web-server, and I wanted to convert the .htaccess files, the problem is not just the syntax but also the file name, is it also ".htaccess" or what?
推荐答案
这是我使用的一个工具:
Here's a tool I use:
http://www.anilcetin.com/convert-apache-htaccess-to-nginx/
它不是 100% 准确,但它是相当好的基础
It is not 100% accurate but it's pretty good base
另外,这里有一个关于转换规则的链接:
Also, here's a link about converting the rules:
http://nginx.org/en/docs/http/converting_rewrite_rules.html
这个可以帮助一点:
http://wiki.nginx.org/HttpRewriteModule#rewrite
文件名应该是nginx.conf
这篇关于更改 Apache .htaccess 文件以与 Nginx 一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!