php - 在 Apache 服务器上将特定的 .htm 页面处理为 .php

标签 php html apache .htaccess

<分区>

我正在为 Apache 服务器编程,我只需要将一个特定的 html 页面(例如,first.htm)作为 PHP 脚本处理。是否可以设置?

最佳答案

SetHandler也可以使用指令:

Forces all matching files to be processed by a handler

When placed into an .htaccess file or a or section, this directive forces all matching files to be parsed through the handler given by handler-name.

<Files first.htm>
    SetHandler application/x-httpd-php
</Files>

关于php - 在 Apache 服务器上将特定的 .htm 页面处理为 .php,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11234010/

相关文章:

php - ElasticSearch:关联分数被function_score覆盖

javascript - Bootstrap 菜单图标更改为 x 关闭

php - 在 Windows XP 上创建虚拟 LAMP 机器的最简单方法?

python - apache python 错误

php - 完成后在ajax之后获取变量

php代码不输出utf 8字符?

php - 从 mysql 表中获取不同的行,该表是特定于用户 id 的最后一个条目

javascript - HTML 5 UI 组件标记库(如 jQuery Mobile)

java - AHK 使用 getElementByID 查找/选择元素

apache - 同一域中两个应用程序的 SSL 代理(一个应用程序没有上下文路径)