我需要从Apache改为Nginx,但是.htaccess不能在Nginx服务器上工作。我在Apache .htaccess中得到了跟踪RewriteRule .$ index.php# don't let people peek into directories without an index file当我在Nginx服务器上放置一个.ht
我是Nginx的新成员,对于我的项目,我需要将所有请求重写到index.php,这是请求处理程序。我在Apache中使用.htaccess文件完成了这个任务,但现在我想让它与Nginx兼容。我知道在Nginx上不存在.htaccess文件,所以我必须在/etc/ Nginx /site中编辑虚拟主机文件-可用/默认,但我不知道哪一个等同于我以前的Apache规则。下面是我以前的.htaccess文件的内容:
Re