在/config/config.php中添加以下两行
'htaccess.RewriteBase' => '/',
'htaccess.IgnoreFrontController' => true,
然后站点根目录下运行sudo -u xxx php occ maintenance:update:htaccess
其中xxx替换成openlitespeed运行用户名
重启OpenLiteSpeed,然后刷新Nextcloud,导航栏链接中的index.php全部消失
生成的共享链接中的index.php同样去掉了。
===================分割线=====================
PS:刚开始时只添加了'htaccess.RewriteBase' => '/',
并未起作用,链接中的index.php依然存在
根据参考中的说明发现在mod_env未开启或受限制的情况下,htaccess.IgnoreFrontController
需要设置为true
才会起作用
而Litespeed正好是属于该情况,LSAPI模式,mod_rewrite支持,但mod_env并未完全支持。
参考:
- https://www.orgleaf.com/2296.html
- https://newsn.net/say/nextcloud-url-nginx.html
- http://www.orgleaf.com/3195.html
- https://docs.nextcloud.com/server/16/admin_manual/configuration_server/config_sample_php_parameters.html
- https://help.nextcloud.com/t/stop-inserting-index-php-with-apache-fastcgi/9543/11