How to change "nexcloud" name in url path?

Hello,
I’ve finished to install Nextcloud 13 in /www/nextcloud. To grant more security I prefer to rename the common url with another name. Is there a way to do that editing .htaccess in /www/nextcloud/?
I tried to change (and update htaccess) ‘overwrite.cli.url’ and ‘htaccess.RewriteBase’ with another name but it does not works.
I also tried to make a RewriteRule in .htaccess (both in /etc/apache2 and in /www/nextcloud) but it still does not works.
Thanks.

What is the nature of the error message? Do you get a 404?

Apache probably does not allow .htaccess files to override RewriteRules. Do you have root access to your webserver? You could then check the logs and/or add a RewriteRule in the vhost configuration.

1 Like

After changing the folder name and updating config.php, what errors do you see?

I have not changed directory name because I read it is necessary to left “nextcloud” directory to have official update. Is it correct?

I also put
#RewriteRule ^mycloud/(.*) nextcloud/$1

in /etc/apache2/sites/available/defaukt.conf inside <VirtualHost *:80> but it does not works.

If I choose a redirect
Redirect 301 ^mycloud http://www.google.com
it works. But it is a redirect, not a rewrite.

#RewriteRule ^mycloud/(.*) nextcloud/$1

Did you actually put it in the file with the dash? Because then it is commented and not active.

I commented the line because it does not works. I left it in htaccess to remember the test I did.

Now I changed the name of the directory in which I installed nexcloud, updated config.php (and .htaccess with occ) and it seems to work.
Now, the question is: is it correct to change folder name? System operation and updates remain unaffected?