2013-03-11 82 views
0

我有以下目录结构:重定向到根目录的index.php所有传入的请求

/.htaccess 
/index.php 
/subfolder1/.htaccess 
/subfolder1/index.php 
/subfolder2/.htaccess 
/subfolder2/index.php 

我想重定向所有请求的index.php。我想通过在/.htaccess文件中进行一些更改来实现这一目标。

e.g. /abc to be rewritten to /index.php 
e.g. /subfolder1/index.php to be rewritten to /index.php 

我该如何使用webroot/.htaccess文件来做到这一点?

我想这样做是因为我想在/index.php上显示一条消息,如'维护网站'。我想为网站上的所有子文件夹执行此操作。

回答

1

如果存在子文件夹,则根中的.htaccess将无效。 我的意思是,它会找到该文件夹​​并且不会重写。

也许你能找到这个问题的答案: similar question

相关问题