Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Need help re: Rewrite Rule for Nextcloud in OLS
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Need help re: Rewrite Rule for Nextcloud in OLS

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{HTTP_USER_AGENT} DavClnt
  RewriteRule ^$ /remote.php/webdav/ [L,R=302]
  RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
  RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
  RewriteRule ^remote/(.*) remote.php [QSA,L]
  RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
  RewriteRule ^\.well-known/(?!acme-challenge|pki-validation) /index.php [QSA,L]
  RewriteRule ^(?:\.(?!well-known)|autotest|occ|issue|indie|db_|console).* - [R=404,L]
</IfModule>

This is the default .htaccess for the nextcloud installation. Anyone know how I can make this work with OpenLiteSpeed? Just want to migrate particularly this part

      RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
      RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]

Thank you for anyone who can help.

Comments

  • I think that has been preconfigured.

    Thanked by 2edoarudo5 Alireza
  • Yes, it doesn't work out of the box though as OLS cannot interpret it as it is coded. It works fine for LS Enterprise though.

  • This resolved. It seems like a modsecurity and header problem that's why the webserver cannot recognize the redirect in .htaccess even if it is indeed read... It turns out the configuration above is correct. Thank you @aRNoLD for your feedback, very much appreciated. It is indeed preconfigured.

Sign In or Register to comment.