服务器为windows环境,用IIS + Rewrite.dll + httpd.ini的方法进行隐藏index.php。
现在出现一个这样的问题:
IIS中默认文档顺序把index.html放在第一位。入口文件为index.php,和它同目录下存在index.html,如果通过域名访问网站,例如 http://www.abc.com 访问,404。如果直接把网址输入完全http://www.abc.com/index.html,却能访问。
我httpd.ini 是这样写的:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^.]+)$ /index\.php/$1 [L]
怎么样才能做到域名访问,首先是进入index.html这个引导页,谢谢大家
=========
按照@niceeo 的方法写
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule /index\.html(.*) /index.php [N,I]
这种方法虽然直接域名就可以访问了。但是入口文件 index.php 就无法隐藏了。
最佳答案