【发布时间】:2012-03-11 06:26:30
【问题描述】:
谁能提供一个 .htaccess 规则,让我的 index.php 覆盖我的 index.html?
这意味着当我转到 http://localhost 时会提供 index.php 而不是 index.html。
【问题讨论】:
谁能提供一个 .htaccess 规则,让我的 index.php 覆盖我的 index.html?
这意味着当我转到 http://localhost 时会提供 index.php 而不是 index.html。
【问题讨论】:
这样就可以了:
DirectoryIndex index.php index.html
如果没有 index.php,则将提供 index.html 文件。
【讨论】:
这可能会起作用...
RewriteEngine On
RewriteBase /
RewriteRule ^index.html$ index.php [R=301,L]
【讨论】:
在 apache 配置文件(或 .htaccess)中,将 DirectoryIndex 设置为 index.php,而不是 index.html
【讨论】: