Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} DavClnt
RewriteRule ^$ /remote.php/webdav/ [L,R=302]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only works for the root directory and if the RewriteBase is set. Please add this to

$content .= "\n RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]";
and remove the leading / before remote.php to be compatible with sub folders. Then this is good to go in

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my case RewriteBase was not in use and ist works.

And it's only required for the root directory. If Nextcloud ist installed in a sub directory, the problem does not occour.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it's only required for the root directory. If Nextcloud ist installed in a sub directory, the problem does not occour.

But we would redirect to /remote.php/webdav/ instead of ´/sub/remote.php/webdav/`... even if it is never requested like this it could cause huge headaches.

@LukasReschke @nickvergessen Opinions of introducing a rewrite condition that works and fixes a problem if installed in root, but creates a redirect to "outside of nextcloud" for the sub directory install, but there it is never requested by Windows anyways. (I tested this and it works)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Nextcloud ist installed in a sub directory, the "RewriteRule ^$" in the .htaccess of the sub directory will do nothing. Or am I wrong?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Nextcloud ist installed in a sub directory, the "RewriteRule ^$" in the .htaccess of the sub directory will do nothing. Or am I wrong?

It does, because it get's only the stuff handed in within it's subdirectory. And then it redirect to the root (because of the leading slash in /remote.php/dav). Therefore I tested this with windows and it doesn't request the subdirectory.

RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L]
RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
Expand Down