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 配置文件参考收藏
- Openlitespeed /litespeed 常用的伪静态(rewrite)规则大全
- Openlitespeed /litespeed 添加HSTS的方法
- how to do install LibXml2 , LibXslt for centos 7
- DirectAdmin更改Apache或openlitespeed服务器为nginx
- Openlitespeed启用php74的详细方法
- how to find out the ssh port of the cpanel host
- Method to cancel ssh key password
- 3 ways to implement domain name jump to www including https using 301