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 常用的伪静态(rewrite)规则大全
- openlitespeed/litespeed禁止访问文件夹和文件的方法
- Openlitespeed /litespeed 配置文件参考收藏
- Openlitespeed /litespeed 添加HSTS的方法
- 重设litespeed的web管理密码
- 3 ways to implement domain name jump to www including https using 301
- 100 Things to Do Between Couples
- mediawiki 在网站根目录下的apache/openlitespeed伪静态规则
- Why should I switch litespeed to caddy
- 使用301实现域名跳转到www包括https的3种方法