Mod rewrite modrewrite未使用htaccess重定向

Mod rewrite modrewrite未使用htaccess重定向,mod-rewrite,url-rewriting,Mod Rewrite,Url Rewriting,当我键入domain.ca/keyword.html时,它应该使用domain.ca/keyword.php进行呈现,但它没有。这是我的htaccess文件中的全部内容 Options +FollowSymLinks Options -Indexes RewriteEngine On RewriteBase / RewriteRule ^(.*)\.html$ $1.php [NC] RewriteCond %{REQUEST_URI} !^/robots.txt$ [NC] Rew

当我键入domain.ca/keyword.html时,它应该使用domain.ca/keyword.php进行呈现,但它没有。这是我的htaccess文件中的全部内容

Options +FollowSymLinks
Options -Indexes

RewriteEngine On
RewriteBase /   

RewriteRule ^(.*)\.html$ $1.php [NC]

RewriteCond %{REQUEST_URI} !^/robots.txt$ [NC]
RewriteCond %{REQUEST_URI} robots\.txt [NC]
RewriteRule .* http://domain.ca/robots.txt [R=301,L]

如果.html存在就需要它,如果它不搜索,就使用它。phpI在我的实时主机上测试了您的确切代码,效果很好。您的.htaccess中是否有其他能够正常工作的重写代码?也许这与您的主机配置有关。