Remove index.php nextcloud và owncloud

cd /www/wwwroot/drive.tndp.net/

sudo -u www php occ maintenance:update:htaccess

sudo -u www php occ db:add-missing-indices

sudo -u www php occ maintenance:repair --include-expensive

----------------------------------------------------------

B1: config.php:

'overwrite.cli.url' => 'https://cloud.mediasme.net',
'htaccess.RewriteBase' => '/',
'htaccess.IgnoreFrontController' => true,

B2: .htaccess:

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]
RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1]
RewriteCond %{REQUEST_FILENAME} !\.(css|js|svg|gif|png|html|ttf|woff2?|ico|jpg|jpeg|map|webm|mp4)$
RewriteCond %{REQUEST_FILENAME} !core/img/favicon.ico$
RewriteCond %{REQUEST_FILENAME} !core/img/manifest.json$
RewriteCond %{REQUEST_FILENAME} !/remote.php
RewriteCond %{REQUEST_FILENAME} !/public.php
RewriteCond %{REQUEST_FILENAME} !/cron.php
RewriteCond %{REQUEST_FILENAME} !/core/ajax/update.php
RewriteCond %{REQUEST_FILENAME} !/status.php
RewriteCond %{REQUEST_FILENAME} !/ocs/v1.php
RewriteCond %{REQUEST_FILENAME} !/ocs/v2.php
RewriteCond %{REQUEST_FILENAME} !/robots.txt
RewriteCond %{REQUEST_FILENAME} !/updater/
RewriteCond %{REQUEST_FILENAME} !/ocs-provider/
RewriteCond %{REQUEST_FILENAME} !/ocm-provider/
RewriteCond %{REQUEST_URI} !^/\.well-known/(acme-challenge|pki-validation)/.*
RewriteRule . index.php [PT,E=PATH_INFO:$1]
RewriteBase /
<IfModule mod_env.c>
SetEnv front_controller_active true
<IfModule mod_dir.c>
DirectorySlash off
</IfModule>
</IfModule>
</IfModule>

B3: Cấp write permission cho file config.php

B4: sudo -u www-data php /www/wwwroot/yournextcloud/occ maintenance:update:htaccess

-----------------------------------

https://manjaro.site/fix-data-directory-warning-nextcloud/

https://help.nextcloud.com/t/data-directory-accessable-from-the-internet/5189/5

https://help.nextcloud.com/t/solved-opcache-module-not-properly-configured/175941/2

https://theselfhosting.art/how-to-setup-the-fastest-nextcloud-ever-on-debian-11/

Did you find this article useful?