Redirect 如何从“重新定向”;domain.com/folder/index.html“;至;domain.com/folder";

Redirect 如何从“重新定向”;domain.com/folder/index.html“;至;domain.com/folder";,redirect,Redirect,我的网站运行在nginx上 我有代码将我的根index.html重定向到域名,但我不知道如何将文件夹中的index.html文件重定向到301重定向的文件夹 示例root/folder/index.html到root/folder 这段代码在htaccess中工作,将root index.html重定向到域名 RewriteCond%{THE_REQUEST}^[A-Z]{3,9}\/index\.html\HTTP/ 重写规则^index\.html$http://%{http_HOST}/[

我的网站运行在nginx上

我有代码将我的根index.html重定向到域名,但我不知道如何将文件夹中的index.html文件重定向到301重定向的文件夹

示例root/folder/index.html到root/folder

这段代码在htaccess中工作,将root index.html重定向到域名
RewriteCond%{THE_REQUEST}^[A-Z]{3,9}\/index\.html\HTTP/

重写规则^index\.html$http://%{http_HOST}/[R=301,L]

您的web服务器的操作系统是什么?你能展示你目前的重定向代码吗?你在使用PHP吗?节点?红宝石什么这个问题不够具体,如果我在nginx上运行的repmy站点数量不多,我会投反对票。我更新了请求,谢谢。寻找htaccess解决方案