Pretty url remove '/nextcloud'

Nextcloud version : 13.0.5
Operating system and version: Debian 9
Apache :2.4.25
PHP version : 7.0.3

Hi there,

To use my web interface i would like to use ‘example.org’ instead of ‘example.org/nextcloud’ so i tried the procedure described in the doc, here is my /var/www/nextcloud/config/config.php: ( i dont have any vhost or other app on the server)

[…]
‘overwrite.cli.url’ => ‘example[.]org/nextcloud’,
‘htaccess.RewriteBase’ => ‘/nextcloud’,
[…]

I also tried:
‘overwrite.cli.url’ => ‘example[.]org’,
‘htaccess.RewriteBase’ => ‘/’,

But i still have have to use ‘/nextcloud’ to access it. I have checked the correct modules are loaded ( rewrite and env):

a2enmode rewrite

Module rewrite already enabled

When i run the command “sudo -u www-data php /var/www/nextcloud/occ maintenance:update:htaccess” i got no error : htaccess has been updated

But i noticed that no matter what i put in my config.php (if i replace ‘example[.]org/nextcloud’’ by ‘toto.tutu’ and run the command “occ maintenance:update:htaccess…” nothing changed, i still can access my nextcloud the same way.

So i suspect that the configuration is not taken into account, maybe a problem with the .htaccess file. So i modified the value “upload_max_filesize” from 511M to 1024M in the file “/var/www/nextcloud/.htaccess”, run again occ maintenance:update:htaccess and even restart apache2 but when i go to my control pannel of my web interface i still see 511M.
(Merci @Nemskiller for your help in the post “Nextcloud 13 pretty urls not working”).

Here is my ‘/etc/apache2/sites-available/nextcloud.conf’ (i made a symbolic link as described in the doc: “ln -s /etc/apache2/sites-available/nextcloud.conf /etc/apache2/sites-enabled/nextcloud.conf” )

Alias /nextcloud “/var/www/nextcloud/”

<Directory /var/www/nextcloud/>
Options +FollowSymlinks
AllowOverride All

Dav off

SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud

Other useful info:
-> Installation directory: /var/www/nextcloud
-> ‘/var/www/nextcloud/.htaccess’ is writeable by www-data

And here is my .htaccess file:
https://pastebin.com/ATREYJ0z

PS: Because of the security rule of the forum, i had to change the address http:// example . org by “example.org” or "example[.]org

Remove the alias line, restart your apache and try example.org

Note that pretty URLs and the occ/.htaccess related steps are for removing the /index.php/ from the URL, not the /nextcloud/.

Not sure if it’s possible to achieve the latter with a similar method, at least never heard of it.

Why do you not just move your webroot to /var/www/nextcloud/ to avoid all rewrite and alias steps that might somehow have a similar but surely crippled result?

Remove/leaving the Alias line from config should not break or enable access via domain, but just allows an additional access URL, AFAIK, it’s about the webroot.

Thank for your replies, removing the alias line didn’t help :frowning: I think i am going to try the proposition of Michalng which seems more convenient. Thanks

You also have to modify the url in your config.php and the more important ;
In your apache website conf file you must have this line :
ServerName example.org

If Nextcloud should be accessed on the root of the domain , url.com , keep in mind the following:

  • Any vhost entries in Apache configs referring to the directory path /var/www/html should be changed to /var/www/html/nextcloud
  • The Nextcloud config.php base URL should be changed from '/nextcloud' to '/'
  • Lets Encrypt will work, however the .well-known directory will need to be moved out and back in to the nextcloud directory before and after an upgrade respectively to avoid an integrity check error.