.htaccess 在内部重定向到index.php

.htaccess 在内部重定向到index.php,.htaccess,redirect,url-redirection,.htaccess,Redirect,Url Redirection,我正在尝试将所有/docs/*请求重定向到/docs/,以便index.php能够处理它 RewriteEngine on RewriteBase / RewriteCond %{REQUEST_URI} ^/docs/[a-z]+ RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^docs/(.*)$ /docs/ [L,QSA] 但是上面的.htaccess配置抛出以下错误 由于可能的配置错误,请求超出了10个内部重定向的限制。请尝试以下

我正在尝试将所有
/docs/*
请求重定向到
/docs/
,以便index.php能够处理它

RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_URI} ^/docs/[a-z]+
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^docs/(.*)$ /docs/ [L,QSA]
但是上面的.htaccess配置抛出以下错误

由于可能的配置错误,请求超出了10个内部重定向的限制。请尝试以下方法:

RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_URI} ^/docs/[a-z]+
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^docs/(.*)$ /docs/index.php/$0 [L,QSA] 

我不想重定向到另一页。我只有一页。index.php。我想在内部将所有请求重定向到同一页面。所以,
/docs/$1
不是我需要的。是的,它就在那里。它应该处理/docs/中的所有文件请求并检查更新的答案。现在index.php将处理所有请求在外部文档中查看index.php文件。并检查此
RewriteRule^docs/(*)$index.php/$0[L,QSA]