URL重写不起作用 - 重写.htaccess中的规则

Vit*_*hya 0 php .htaccess

我在apache中启用了重写模块.后来我在root中开发了.htaccess文件.

RewriteEngine On
RewriteRule ^test.html $ test.php
Run Code Online (Sandbox Code Playgroud)

但它不起作用?发生内部服务器错误.接下来做什么?

Art*_*cto 7

我说mod_rewrite没有打开,或者.htaccess文件中不允许这样做.检查错误日志.

你的规则也是错的,它应该是

RewriteRule ^test\.html$ test.php
Run Code Online (Sandbox Code Playgroud)

圆点表示"任何字符",应该被转义; 你之后还有一个空间html.