由于 mod_rewrite,DirectoryIndex 无法工作?
对 www.domainname.com 和domainname.com 的请求应显示index.html,而不是像现在那样显示index.php。
这是 .htaccess 文件:
# -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 index.html,但这不起作用。我怀疑这与 mod_rewrite 的东西有关,但作为一个 apache-n00b,我真的只是在抓住救命稻草。
我可以添加重写规则吗?或者我应该做什么?
Requests to www.domainname.com and domainname.com should display index.html, not index.php as it does now.
This is the .htaccess file:
# -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
I tried adding a DirectoryIndex index.html to the file, but that did not work. I suspect that has something to do with the mod_rewrite stuff, but being an apache-n00b I am really just grasping for straws.
Can I add a rewriterule, or what should I do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
奇怪的是,你的 .htaccess 对我来说工作得很好,当我请求目录时我得到了index.html。
您可以尝试插入此规则:
如果这不起作用,请获取一些调试信息:
Strangely, your .htaccess works fine for me and I get index.html when I request the directory.
You might try inserting this rule:
If that doesn't work, get some debug information: