欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

apache rewrite 无法匹配'index'字符串

程序员文章站 2022-04-29 19:40:11
...
.htaccess

RewriteEngine on
RewriteCond $1 !^(index\.php|static|robots\.txt)
RewriteRule ^(.*)$ configure.php/$1 [QSA,PT,L]

以下都可以成功匹配:
http://localhost/admin/index/index
http://localhost/indexa/index/index
http://localhost/indexb/index/index

唯独: index开始的无法匹配:
http://localhost/index
http://localhost/index/index/index
错误提示:
Not Found
The requested URL /index/index/index was not found on this server.

没有与目录下的任何文件重名

回复内容:

.htaccess


RewriteEngine on
RewriteCond $1 !^(index\.php|static|robots\.txt)
RewriteRule ^(.*)$ configure.php/$1 [QSA,PT,L]

以下都可以成功匹配:
http://localhost/admin/index/index
http://localhost/indexa/index/index
http://localhost/indexb/index/index

唯独: index开始的无法匹配:
http://localhost/index
http://localhost/index/index/index
错误提示:
Not Found
The requested URL /index/index/index was not found on this server.

没有与目录下的任何文件重名