如何执行带有.html扩展名的php文件? [英] How to execute php files with .html extension?

查看:94
本文介绍了如何执行带有.html扩展名的php文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站有问题,当我尝试将php转换为html时,出现此错误 未找到

i have problem with my site, when i try to convert php to html, i got this error Not Found

这是.htaccess

and this is .htaccess

RewriteEngine on
RewriteRule ^(.*)\.php$ /ver1/$1.html [R=301,QSA,L]

文件夹ver1中的所有文件

all files in folder ver1

我看到这则帖子

.php url到.html url

但不能和我一起工作

我只需要将php转换为html,如果我转到index.php

i just need convert php to html and if i go to index.php

我转到index.html并将所有网址设置为html

i go to index.html and make all url html

推荐答案

将.php文件重命名为.html,并将此行添加到.htaccess中

Rename your .php file to .html and add this line in your .htaccess

AddType application/x-httpd-php .html .htm

这篇关于如何执行带有.html扩展名的php文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆