代码之家  ›  专栏  ›  技术社区  ›  Kjensen

由于mod\u重写,DirectoryIndex无法工作?

  •  0
  • Kjensen  · 技术社区  · 16 年前

    请求www.domainname.com domainname.com应该显示index.html,而不是像现在这样显示index.php。

    # -FrontPage-
    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    # RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    

    我尝试向文件中添加DirectoryIndex.html,但没有成功。我怀疑这与modu重写的东西有关,但作为一个apache-n00b,我真的只是在抓救命稻草。

    1 回复  |  直到 16 年前
        1
  •  0
  •   Jeremy Stein    16 年前

    您可以尝试插入此规则:

    RewriteCond ^/$ /index.html [L]
    

    如果不起作用,请获取一些调试信息:

    RewriteLog "/some/writable/path/rewrite.log"
    RewriteLogLevel 3
    
    推荐文章