Removing index.php from URL doesn't seem to work for me

I’ve followed a number of threads like this one on the subject but can’t seem to get this to work:

I have the same issue as the final poster who never got an answer.

  • I’ve validated that mod_env and mod_rewrite are loaded
  • I’ve added the lines to my .htaccess file
  • I’ve run occ maintenance:update:htaccess

When I add ‘htaccess.IgnoreFrontController’ => true, to my config.php file it DOES remove the index.php from the URL, however non of the css assets load, so the pages are all messed up.

Is there an extra config setting to fix the css assets that I am missing?

Thanks for any help!

Did you also try the official documentation? Installation on Linux — Nextcloud 34 Administration Manual

In general, there should be no need to edit .htaccess manually, and you probybly don’t need to set htaccess.IgnoreFrontController => true, either, unless one of the conditions described here applies to your setup: Configuration Parameters — Nextcloud 34 Administration Manual

In most cases you just need to enable mod_env and mod_rewrite, and add the following to your config.php:

For an installation in the web root:

'overwrite.cli.url' => 'https://cloud.yourdomain.tld/',
'htaccess.RewriteBase' => '/',

Or, if Nextcloud is installed in a subdirectory of the web root:

'overwrite.cli.url' => 'https://cloud.yourdomain.tld/nextcloud',
'htaccess.RewriteBase' => '/nextcloud',

Then run:

occ maintenance:update:htaccess

If that doesn’t work, please provide more information about your setup, ideally by filling out the Support Template.

Thank you!! That worked.

Adding 'htaccess.RewriteBase' => '/', did the trick! I had the mods enabled and the overwrite.cli.url' => 'https://nextcloud.example.com/', directive in there.

After running occ maintenance:update:htaccess I did need to force a reload with Ctrl+F5 to fix the broken css asset links, but now it is working properly!

I really appreciate the help. Thank you.