Apache Mod Rewrite导致错误::HTTP请求重定向过多

Apache Mod Rewrite导致错误::HTTP请求重定向过多,apache,.htaccess,mod-rewrite,redirect,Apache,.htaccess,Mod Rewrite,Redirect,我正在使用服务器上我的/api文件夹中的以下.htaccess文件: 我只是向url发出http请求。但是,我一直收到过多的重定向错误 重新启动发动机 重写BASE/api/ #如果请求的资源作为文件或目录存在,请转到它 RewriteCond%{REQUEST_FILENAME}-f[或] RewriteCond%{REQUEST_FILENAME}-d 重写规则(.*)-[L] #否则将对不存在资源的请求重写到/index.php 重写规则^(.*)$/index.php?请求=$1[L]

我正在使用服务器上我的/api文件夹中的以下.htaccess文件:

我只是向url发出http请求。但是,我一直收到过多的重定向错误


重新启动发动机
重写BASE/api/
#如果请求的资源作为文件或目录存在,请转到它
RewriteCond%{REQUEST_FILENAME}-f[或]
RewriteCond%{REQUEST_FILENAME}-d
重写规则(.*)-[L]
#否则将对不存在资源的请求重写到/index.php
重写规则^(.*)$/index.php?请求=$1[L]

我只想重定向到索引文件,如果文件夹和目录不存在,则将
[resource]
附加到参数“request”。救命啊

我认为在
index.php…
之前不需要那个前导斜杠。也许重定向来自您的应用程序?您是否已检查浏览器控制台的“网络”选项卡?但此处没有重定向,只有内部重写。在Apache配置中是否有其他.htaccess或任何规则
<IfModule mod_rewrite.c>
RewriteEngine on 
RewriteBase /api/


# If requested resource exists as a file or directory go to it
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule (.*) - [L]

# Else rewrite requests for non-existent resources to /index.php
RewriteRule ^(.*)$ /index.php?request=$1 [L]

</IfModule>