Updating .htaccess with occ not working


#1

I migrated my owncloud to Nextcloud,
like the manual says here: https://nextcloud.com/migration/
All permissions are correct.

On my owncloud installation i got the index.php hiding because of the rewritebase and the .htaccess.
When i ran
sudo -u www-data php occ maintenance:update:htaccess
with nextcloud, my .htaccess did not change.

I deleted my .htacess and ran the command again,
the only result was a .htaccess file with these lines:
#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####

ErrorDocument 403 /core/templates/403.php
ErrorDocument 404 /core/templates/404.php

Looks like the occ command does not update/create the htaccess correct.

I updated the .htaccess manually with the code from my OC installation
and it worked.

I already tried it with permission 777 on .htacces but nothing changed.


Nextcloud version (eg, 10.0.2): 11
Operating system and version (eg, Ubuntu 16.04): 16.04
Apache or nginx version (eg, Apache 2.4.25): 2.4.18
PHP version (eg, 5.6): 7.0


#2

As far as i know, this will update only the section for rewrite index.php


#3

You should have something like this:
http://pastebin.com/WSgbBe6R

See here.


#4

Are you using SELinux?
If so you have to do additional SELinux configuration.


#5

But it does not, just the htaccess like it was before, no rewrite rule or sth added after the command.

That was in there, so the initial file was correct but no update was done.

Nope, using Ubuntu Server.


#6

The last link I sent explained why.