我是OpenLitespeed web服务器的新用户。之前我使用Apache作为我的web服务器。现在,我对OpenLitespeed中用于安全目的的.htaccess感到困惑。
great my .htaccess rule在Apache中运行良好
IndexIgnore *.css *.js *.png *.jpg
Options -Indexes
ErrorDocument 400 index.php
ErrorDocument 403 index.php
ErrorDocument 404 index.php
ErrorDocument 500 index.php
<Files ~ "\.optl$">
Order allow,deny
Deny from all
</Files>如何在OpenLiteSpeed网络服务器中使用此规则?谢谢
发布于 2017-04-07 10:19:03
我不确定这是正确的答案,但我把它放在这里,以防你需要它:
OpenLitespeed以另一种方式支持.htaccess。您可以从.htaccess复制重写规则并粘贴到OpenLiteSpeed管理控制台:
https://serverfault.com/questions/538249/does-openlitespeed-support-apache-rewrites
更新:是的,我刚刚测试了它,因为我现在遇到了这个问题。它确实起作用了。
发布于 2018-05-15 23:21:18
用于OpenLitespeed web服务器。
您可以通过Virtual Host -> General -> Customized Error Pages设置ErrorDocument
错误码支持你所需要的一切。例如300 ~ 505,包括400,403,404,500。
您可以通过Virtual Host -> General -> Index Files设置索引文件
以上两个规则可能不支持“另一种方式”,这就是为什么你需要从网络管理设置。“另一种方式”只支持重写规则。
发布于 2018-08-10 08:35:13
在openlitespeed中,你必须将你的.htaccess文件指向虚拟主机。从openlitespeed admin Klik virtualhost ->中选择您的虚拟主机,在选项卡中选中重写选项卡中的'Yes‘以启用重写,并重写规则插入文件.htaccess的路径,例如/usr/local/lsws/yourweb/.htaccess
并重新启动您的openlitespeed服务器
/usr/local/lsws/bin/lswsctrl restart您可以使用脚本自动安装,并支持来自https://github.com/tujuhion/openlitespeed-centos-autoinstall的多个vhost
https://stackoverflow.com/questions/41298594
复制相似问题