使用 .htaccess 在目录(包括所有子目录)中禁用 PHP [英] Disable PHP in directory (including all sub-directories) with .htaccess

查看:28
本文介绍了使用 .htaccess 在目录(包括所有子目录)中禁用 PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个允许人们上传文件、html 页面等的网站...现在我遇到了问题.我有这样的目录结构:

I'm making a website which allows people to upload files, html pages, etc... Now I'm having a problem. I have a directory structure like this:

-/USERS
    -/DEMO1
    -/DEMO2
    -/DEMO3
    -/etc... (every user has his own direcory here)
-index.php
-control_panel.php
-.htaccess

现在我想禁用 PHP,但在/USERS 中的目录和子目录中启用服务器端包含

Now I want to disable PHP, but enable Server-side includes in the direcories and subdirectories inside /USERS

这能做到吗(以及如何做到:))?提前致谢.

Can this be done (and how :) )? Thanks in advance.

顺便说一句,我使用 WAMP 服务器

BTW, I use WAMP server

推荐答案

尝试禁用 engine 选项:

Try to disable the engine option in your .htaccess file:

php_flag engine off

这篇关于使用 .htaccess 在目录(包括所有子目录)中禁用 PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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