2009-12-13 54 views
0

嗯,这是非常简单的,但我不知道..简单htaccess的问题

我在主目录htaccess文件指向所有PHP文件到index.php的主目录。

RewriteRule ^.*php index.php [L] 

我现在已经创建了像example.com/mydir/一个子目录

我想里面的子目录通用htaccess的是应该指向

example.com/mydir/到example.com/index .php

并且不考虑任何其他文件。

可能吗?

回答

1

您可以从主目录中的.htaccess执行所有操作。见mod_rewrite, a beginner’s guide (with examples)mod_rewriting an entire site

+0

感谢,以及我希望让事情变得简单,顺便说一句哪一个具有多个优先级,在htaccess的家目录或子目录? – 2009-12-13 18:28:17

+0

我不认为你会有任何需要的.htaccess的subdirs ... – Skilldrick 2009-12-13 18:32:46

+0

绝对不是,也看看这些: http://www.webweaver.nu/html-tips/web-redirection .shtml和http://httpd.apache.org/docs/1.3/howto/htaccess.html – 2009-12-13 18:37:07

0

在你取代一个绝对URL路径尝试:

RewriteRule ^.+\.php$ /index.php [L]