Trying to get rid of "index.php" in URL doesn't work

Nextcloud version: 11.0.2
Operating system and version: Ubuntu 16.04.2 LTS
Apache or nginx version: Apache 2.4.25
PHP version: 7.0
Is this the first time you’ve seen this error?: yes

Can you reliably replicate it? (If so, please outline steps):
Steps explained in the video linked below

The issue you are facing:
I have tried to replicate the steps in this official video tutorial but when I execute the first command it says:
sudo: ./occ: command not found
I do have root access in my VPS and Apache allows override. Also the modules required from Apache are installed. I am executing the command from the install folder of my Nextcloud: /var/www/html/cloud

Have you tried it to run it (in the NextCloud folder) in the following way?

sudo -u www-data php occ

Also what is the output if you run:

ls -lah occ

1 Like

It worked. I ran:
sudo -u www-data php occ config:system:set htaccess.RewriteBase --value /
sudo -u www-data php occ maintenance:update:htaccess

and then restarted Apache. I don’t know why I didn’t find this method earlier. I’ll leave it here just in case no one else does.

Thanks @X4LD1M0