最新消息:

Openlitespeed环境下Nextcloud移除链接中index.php

Nextcloud ZmmFly 3025浏览 2评论

在/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并未完全支持。

参考:

  1. https://www.orgleaf.com/2296.html
  2. https://newsn.net/say/nextcloud-url-nginx.html
  3. http://www.orgleaf.com/3195.html
  4. https://docs.nextcloud.com/server/16/admin_manual/configuration_server/config_sample_php_parameters.html
  5. https://help.nextcloud.com/t/stop-inserting-index-php-with-apache-fastcgi/9543/11

转载请注明:神奇海域 » Openlitespeed环境下Nextcloud移除链接中index.php

发表我的评论
取消评论

Protected by WP Anti Spam

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网友最新评论 (2)

  1. 自己用的其实有个index.php也没什么关系吧。
    心灵博客评论于5年前 (2019-06-18)回复
    • 自用的话问题不大,去掉就是看着舒服点
      ZmmFly评论于5年前 (2019-06-18)回复