
Openlitespeed /litespeed deny methods to access folders and files
Openlitespeed /litespeed deny methods to access folders and files
It's very simple, litespeed/openlitespeed is compatible with apache.htacess,
Just write the rule to the.htacess file
Alternatively, add the rules manually through the litespeed/openlitespeed webGUI console
Disabling access to a specified directory, such as bak
1
2
RewriteRule ^bak/.*$-[F,L]
This makes all files in the bak directory inaccessible
Restrict access to all files of specified types such as.log and.db files
1
RewriteRule ^/.*\.(log|ini|db|env)$-(F,L)
It's as simple as that
But it's important to note that the rules are executed from the top down
Here's the problem, assuming the site is accessed through JAVA on the back end of the proxy
If backend JAVA does not restrict access to these files
The rules above should be written in the first article, and the rules for the proxy backend JAVA should be written later.
Of course, when testing, I found that this setup caused a bit of a delay in the site
To learn more about litespeed, see another litespeed article
Official lopenlitespeed documentation
💘 相关文章
- Openlitespeed /litespeed 配置文件参考收藏
- Openlitespeed /litespeed 常用的伪静态(rewrite)规则大全
- openlitespeed/litespeed禁止访问文件夹和文件的方法
- Openlitespeed /litespeed 添加HSTS的方法
- Openlitespeed lsphp进程的启动方法
- 我为什么要把litespeed切换成caddy
- Openlitespeed启用php74的详细方法
- 有意思,openlitespeed的PHP进程重启方式
- litespeed下typecho伪静态规则
- LiteSpeed 旗下特色的免费CDN加速服务QUIC.cloud