的.htaccess拒绝访问特定文件?不止一个

编程入门 行业动态 更新时间:2024-10-24 14:22:22
本文介绍了的.htaccess拒绝访问特定文件?不止一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我可以禁止访问与的.htaccess文件,但我不知道如何禁止多个文件来看待(直接,不是从包括)

I am able to disable access to a file with .htaccess, but I don't know how to disallow multiple files to be viewed (directly, not from includes)

他们的.php,所以我不能禁止的文件类型(如仅在线教程说..)

They are .php so I can't disable a file type (like the only tutorials online say..)

<FILES ... ? </FILES>

或东西..例如home.php,为file.php,test.php的我怎么禁止访问所有三个文件包含该标签的?或类似的,帮助请!

Or something.. For example "home.php, file.php , test.php" how do I disallow access to all three files with that tag? or similar, help please!

推荐答案

如果您想根据定期EX pressions排除的文件,你可以使用FilesMatch而不是文件,如:

If you want to exclude files based on regular expressions, you could use FilesMatch instead of Files, e.g.:

<FilesMatch ^((home|test|file)\.php$|mysecretfolder|asecretpicture\.jpe?g)$> ... </FilesMatch>

更多推荐

的.htaccess拒绝访问特定文件?不止一个

本文发布于:2023-10-31 12:52:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546140.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   htaccess

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!