我读过这个问题:如何在子文件夹中设置索引页。我想这样做,我有这些文件夹和文件:
index.php
items/
items/index.php
当我搜索";项目/一般";,然后items/index.php处理它,而不是index.php
RewriteEngine On
RewriteRule ^/?$ items/index.php [L]
但是当我搜索";项目/一般";,它给出一个404错误,如下所示:
Not Found
The requested URL was not found on this server.
(我的items/index.php包括一个代码,用于向所有请求发送html(
为什么不起作用?
您可以使用类似的东西:
RewriteRule items/ items/index.php [L]
如果你想要一个genaric规则/any folder/any-file.php到/any folder/index.php
RewriteRule (w+)/ $1/index.php [L]