php:newbie modrewrite问题

时间:2011-04-28 19:39:48

标签: apache .htaccess mod-rewrite

我在php下使用modrewrite有点问题。 这是在我的.htaccess文件中:

RewriteEngine On
RewriteRule ^test.html$ test.php
RewriteRule ^index.html$ index.php

它适用于test.html - > test.php的 但是当我尝试加入我的域名时,我收到了404错误,例如www.domain.com/index.html 虽然它是相同的结构,应该工作..:/ 使用www.domain.com时,只有它有效。

知道使用index.php有什么问题 - >的index.html?

感谢

1 个答案:

答案 0 :(得分:2)

听起来像index.php不存在。

当你转到http://www.domain.com时,它会打到index.html(或index.php),在index.html的情况下,它会激活你的重写规则(因为请求uri是/或空字符串) )

相关问题