Mod rewrite htaccess*.php到*.html对象未找到错误
我正在尝试将URL从index.php转换为index.html,从servicii.php转换为servicii.html等等 我在根目录中的.htaccess文件中编写了以下代码:Mod rewrite htaccess*.php到*.html对象未找到错误,mod-rewrite,http-status-code-404,Mod Rewrite,Http Status Code 404,我正在尝试将URL从index.php转换为index.html,从servicii.php转换为servicii.html等等 我在根目录中的.htaccess文件中编写了以下代码: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^(.*)\.php$ $1.html [R=permanent] </IfModule> ?&g
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)\.php$ $1.html [R=permanent]
</IfModule>
?>
但当我关注Prima pagina Home或Servici网站上创建的仅有2个页面时,它给了我一个404错误
还有,我有密码
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /fetesti/
RewriteRule ^(.*)\.php$ $1.html [R=permanent]
</IfModule>
在我的本地机器上,这是基于XAMPP的。它给出了404中未找到的对象,并且在我的Apache日志中:
未找到文件[…]/index.html
我知道重写引擎正在工作,我胡言乱语,它给了我505个内部服务器错误,并进行了其他测试
我做错了什么?尝试删除[R]永久重定向,并在规则中切换扩展
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)\.html$ $1.php
</IfModule>
请您将您的代码格式化为代码块,以便我们可以轻松阅读?这很有帮助。谢谢