Nextcloud 11.0.1 Allow visitor from a specific referrer domain only


I want to deny all visitor that not come from my domain.

If other domain share my “share link” on their site, then the visitor click the link, they can’t download my files.

They must redirect to 403.

htaccess which one should i edit? It’s possible?

Sorry my english bad.


Try Files Access Control.

Thanks. But unfortunately, file access control does not have a rule to block referrer URL.

If you are using Apache, you should be looking into mod_rewrite for HTTP Referrer based redirects.

A sample configuration would look like

RewriteEngine On
RewriteCond  %{HTTP_REFERER} .*NotThisDomain.*$
RewriteRule ^(.*)$ http://RedirectThemHere/