# Disable Webdav completely?

**URL:** <https://help.nextcloud.com/t/disable-webdav-completely/27573>\
**Category:** ℹ️ Support\
**Created:** [February 15, 2018, 2:49pm UTC](https://help.nextcloud.com/t/disable-webdav-completely/27573 "2018-02-15T14:49:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiteshpatel](https://help.nextcloud.com/letter_avatar/jiteshpatel/32/6_22734026db12803ebb3e059622ac3534.png) [@jiteshpatel](https://help.nextcloud.com/u/jiteshpatel)\
**Post date:** [February 15, 2018, 2:49pm UTC](https://help.nextcloud.com/t/disable-webdav-completely/27573/1 "2018-02-15T14:49:25Z")

</div>

Hi, have two separate clouds on the same server. One is on v12, the other on v13

v13 is a fresh install and it says

"Your web server is not yet properly set up to allow file synchronisation, because the WebDAV interface seems to be broken.:

Yet the v12 installation works fine

---

<div class="post-metadata">

**Author:** ![jiteshpatel](https://help.nextcloud.com/letter_avatar/jiteshpatel/32/6_22734026db12803ebb3e059622ac3534.png) [@jiteshpatel](https://help.nextcloud.com/u/jiteshpatel)\
**Post date:** [February 15, 2018, 3:56pm UTC](https://help.nextcloud.com/t/disable-webdav-completely/27573/2 "2018-02-15T15:56:53Z")

</div>

can you disable it completely

---

<div class="post-metadata">

**Author:** ![Escubaer](https://help.nextcloud.com/user_avatar/help.nextcloud.com/escubaer/32/6091_2.png) [@Escubaer](https://help.nextcloud.com/u/Escubaer)\
**Post date:** [February 15, 2018, 5:54pm UTC](https://help.nextcloud.com/t/disable-webdav-completely/27573/3 "2018-02-15T17:54:31Z")

</div>

WebDav is the protocol used for file operations. So if you disable it, you are essentially making the system unusable 😉

---

<div class="post-metadata">

**Author:** ![dev](https://help.nextcloud.com/letter_avatar/dev/32/6_22734026db12803ebb3e059622ac3534.png) [@dev](https://help.nextcloud.com/u/dev)\
**Post date:** [November 16, 2018, 7:10pm UTC](https://help.nextcloud.com/t/disable-webdav-completely/27573/4 "2018-11-16T19:10:39Z")

</div>

I have disabled it in the past within /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php.  
We don’t want users accessing their files anywhere but from within the web interface so I just added `return false;` within the validateUser function. The fix for NC 12 is here: [https://pastebin.com/7NL383b1](https://pastebin.com/7NL383b1) (ignore the comment about the cron job. it is for my use only). Have not tested with NC 14 yet but will be. I thought I’d look to see if there have been any new ways to disable it before resorting to hacking up core.

---

<div class="post-metadata">

**Author:** ![NCworld](https://help.nextcloud.com/letter_avatar/ncworld/32/6_22734026db12803ebb3e059622ac3534.png) [@NCworld](https://help.nextcloud.com/u/NCworld)\
**Post date:** [May 23, 2019, 12:22pm UTC](https://help.nextcloud.com/t/disable-webdav-completely/27573/5 "2019-05-23T12:22:53Z")

</div>

Im not able to disable or restrict webdav to only the browser.  
The add-on does also not block to only the browser.

Why do i want to block it, i want none admin’s not to access the data via webdav

Anybody a solution ? for NC16 ?

---

<div class="post-metadata">

**Author:** ![gas85](https://help.nextcloud.com/user_avatar/help.nextcloud.com/gas85/32/7772_2.png) [@gas85](https://help.nextcloud.com/u/gas85)\
**Post date:** [May 23, 2019, 2:25pm UTC](https://help.nextcloud.com/t/disable-webdav-completely/27573/6 "2019-05-23T14:25:53Z")

</div>

Try to ether rewrite URL, or redirect to e.g. Login page:

> <https://stackoverflow.com/questions/4596066/how-to-config-apache2-to-redirect-url/4596217#4596217>

---

<div class="post-metadata">

**Author:** ![4d1](https://help.nextcloud.com/letter_avatar/4d1/32/6_22734026db12803ebb3e059622ac3534.png) [@4d1](https://help.nextcloud.com/u/4d1)\
**Post date:** [January 29, 2020, 3:04pm UTC](https://help.nextcloud.com/t/disable-webdav-completely/27573/7 "2020-01-29T15:04:44Z")

</div>

the desktop client tries to get authorization via /index.php/login/v2/grant

you can put this inside your Apache-vhost-config (.htaccess would work too)  
RewriteCond %{REQUEST\_URI} ^/index.php/login/v2/grant  
RewriteRule ^(.\*)$ [https://example.com/index.php/login](https://example.com/index.php/login) [L,R=301]

and some more conditions for the Android client  
RewriteCond %{REQUEST\_URI} ^/index.php/login/flow/grant(._)$ [OR]  
RewriteCond %{REQUEST\_URI} ^/core/js/login/grant(._)$ [OR]  
RewriteCond %{REQUEST\_URI} ^/index.php/login/flow/grant(._)$  
RewriteRule ^(._)$ [https://example.com/index.php/login](https://example.com/index.php/login) [L,R=403]

this only prohibits the android client to authenticate at first login! If the client was already registered, it won’t stop that connection.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 3, 2024, 9:23pm UTC](https://help.nextcloud.com/t/disable-webdav-completely/27573/8 "2024-12-03T21:23:50Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 9, 2024, 2:15pm UTC](https://help.nextcloud.com/t/disable-webdav-completely/27573/9 "2024-12-09T14:15:38Z")

</div>


