web application – Apache – Adding a redirection to a V / S subdirectory that changes DocumentRoot

I want to understand the implications of evolution on security DocumentRoot in Apache on a website installed compared to the addition of one RewriteRule.

The reason I ask this, I have a website that is installed under / var / www / html / website /. I initially changed DocumentRoot to / var / www / html / website in the folder 000-default-the-ssl.conf file. This, however, exposed some elements in an NMAP analysis. Specifically, the JS and CSS files. Examples:

https: //ipaddress/nextcloud/core/js/contactsmenu.js? v = 6e38f86c-7
https: //IPaddress/nextcloud/core/css/guest.css? v = 6e38f86c-7

and some others.

I have examined this unsafe behavior and, therefore, added the following items in the 000-default-ssl.conf configuration file.

I've changed DocumentRoot to / var / www / html and added:

RewriteEngine on
RewriteCond% {REQUEST_URI} ^ / $
RewriteRule (. *) / Nextcloud / [R=301]

Hence my question: is there a security advantage to changing DocumentRoot by default and adding a redirection or the end result is it the same?

Also, I know this is product specific (nextcloud), but should these files be visible?