【发布时间】:2010-09-23 11:39:29
【问题描述】:
1) 我有一个位于http://example.com 的Drupal 站点,我有一个位于http://example.com/foo 的目录,但我也有一个别名为http://example.com/foo 的Drupal 页面.如何让 Drupal 页面提供服务?目前,由于 Drupal 的 .htaccess 文件中的 Options -Indexes 声明,我得到了一个 403 禁止页面,但我不想删除它,因为我不希望目录可浏览。
编辑:我已经用以下规则解决了这个问题:
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*)$ http://localhost/s2k/index.php?q=$1 [L,QSA]
2) 让问题变得更加困难,给定相同的场景,如果我在目录 http://example.com/foo/index.html 中有一个 index.html 文件,我总是希望它优先于 Drupal 的别名页面(目前是这样 - 目前我已经修改了 .htaccess 文件,以便任何带有 index.html 文件的目录都可以显示它 - DirectoryIndex index.php index.html)。
编辑:
那么现在,我该如何编写一个 RewriteCond 来查看目录中是否有 index.html 文件?
【问题讨论】: