Try to remove index.php -> Internal Server Error

my nextcloud was perfectly running, till I wanted to remove the index.php :smiley:

I used the following instruction:

sudo vim /var/www/html/nextcloud/config/config.php

Add ‘htaccess.RewriteBase’ => ‘/nextcloud’, (where nextcloud is the location of the installation) below one of the existing configuration options and finally, from /var/www/html/nextcloud, run:

sudo -u www-data php occ maintenance:update:htaccess

And now I can´t acces any longer my nextcloud:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Apache/2.4.18 (Ubuntu) Server at Port 443

Any ideas?

My config: Ubuntu Server 16.04.1 with Apache, PHP7 und mariaDB
Location of Nextcloud: /var/www/nextcloud
Location of Nextcloud-data: /var/www/nextclouddata

here my config.php:

<?php $CONFIG = array ( 'instanceid' => '...', 'passwordsalt' => '...', 'secret' => '...', 'trusted_domains' => array ( 0 => '', ), 'datadirectory' => '/var/www/nextclouddata', 'overwrite.cli.url' => '', 'htaccess.RewriteBase' => 'var/www/nextcloud', 'dbtype' => 'mysql', 'version' => '', 'dbname' => 'nextcloud', 'dbhost' => 'localhost', 'dbport' => '', 'dbtableprefix' => 'oc_', 'dbuser' => 'DATABASEUSER', 'dbpassword' => 'PASSWORD', 'logtimezone' => 'UTC', 'installed' => true, 'memcache.local' => '\\OC\\Memcache\\APCu', 'memcache.locking' => '\\OC\\Memcache\\Redis', 'filelocking.enabled' => 'true', 'redis' => array ( 'host' => '/var/run/redis/redis.sock', 'port' => 0, 'timeout' => 0.0, ), );
1 Like

Did you try this?

(fill up 20 characters)


'htaccess.RewriteBase' => 'var/www/nextcloud',

Should be

'htaccess.RewriteBase' => '/nextcloud',

As the quote from my guide shows :slight_smile:

Thank you.
But my path is not /var/www/html/nextcloud,it ist just /var/www/nextcloud

It shouldn’t matter. /nextcloud is what you type in the browser to reach your NC instance, so that’s what you put in the config file :thumbsup:

no my domain is without /nextcloud just: (e.g.)

Oh! Sorry

Then just /

Like my production server:

'htaccess.RewriteBase' => '/',

Where nextcloud is the location of the installation would be /var/www/(html/)nextcloud. As yours is in the root / that’s what you’d use.

1 Like

That´s it! Thank you.

1 Like

Mark solved please :slight_smile: