URL Rewrite to remove index.php not working

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version : 23.0.02
Operating system and version: Ubuntu 20.04
Apache or nginx version: 2.4.41
PHP version (eg, 7.4): 7.4.3
Notes about the environment: Apache2 server is proxied through NginxProxyManager running on Unraid

The issue you are facing:
Hello all!
I’m trying to get URL rewriting working to eliminate index.php from my URL. Currently, I’m in a state where navigating to my domain, I get a directory listing for “/apps/dashboard/” (when running with an authenticated session, incognito window just reveals that the page could not be found)

So far I have done the following prior to running the htaccess maintenance command:

in the OS environment
-verified mod_env and mod_rewrite are enabled

in my config.php
-Verified that htaccess.RewriteBase is set to /
-set htaccess.IgnoreFrontController to true

I’m pretty sure I’m missing something, and my level of google-fu is failing me. . . so at this point, I’m reaching out for advice.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '<redacted>',
  'passwordsalt' => '<redacted>',
  'secret' => '<redacted>',
  'trusted_domains' => 
  array (
    0 => '192.168.1.53',
    1 => '<redacted, subdomain.domain.tld>'
  ),
  'datadirectory' => '/mnt/remotes/nextcloud/nextcloud',
  'dbtype' => 'mysql',
  'version' => '23.0.2.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_smiller',
  'dbpassword' => '<redacted>',
  'installed' => true,
  'overwritehost' => '<redacted, subdomain.domain.tld>',
  'overwriteprotocol' => 'https',
  'overwrite.cli.url' => 'https://subdomain.domain.tld/',
  'htaccess.RewriteBase' => '/', 
  'htaccess.IgnoreFrontController' => true,
);

The output of your Apache/nginx/system log in /var/log/____:

just a bunch of exceeded allocated memory errors thrown by php... 
This, I can fix, just need to adjust my php.ini settings

Normally you only must set.
'htaccess.RewriteBase' => '/',
and execute
sudo -u www-data php /path/to/nextcloud occ maintenance:update:htaccess

Hi!
Thanks for that information!
When only that is done, index.php still remains in the url (after removing the htaccess.IgnoreFrontController). This is the current state of my install.

And you have executed the command
sudo -u www-data php /path/to/nextcloud occ maintenance:update:htaccess
without no errors?

Correct! No errors appear during that operation. I have run the command after changing the files both times (to remove the ignorefrontcontroller and to add the ignorefrontcontroller switch)

Sorry. No real idea. Or have you changed something manually in .htaccess?

Nope! htaccess was left as the stock file (other than the modifications by running the occ command). Thanks for looking, though :slight_smile:

Exactly the same issue here. @shawn0 did you find a solution yet?

I haven’t. . . Part of me is suspecting that my nginx proxy manager docker might be meddling, but I haven’t been arsed to confirm.

It was my configuration on my apache, it appears.
I’ve rebuilt the configuration, and the issue no longer occurs. . . . however, I’m not sure what exactly I did to fix it.
Either way, solved.
If anyone cares to peruse, I COULD upload my two apache site configurations. just let me know.

1 Like

Yes please!