Apache: Cant remove "index.php" from my url

Hi, i’m trying to remove the “index.php” from my nextcloud uri, but it just doesnt work.

The Basics

  • Nextcloud Server version:
    • Nextcloud Hub 9 (30.0.6)
  • Operating system and version:
    • Ubuntu 24.04.2 LTS x86_64
  • Web server and version:
    • Apache 2.4.58
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • Apache 2.4.58
  • PHP version:
    • v8.3.17
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Archive
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

I added the 'htaccess.RewriteBase' => '/', entry to my config.php and then executed sudo -u www-data php /var/www/nextcloud_new/occ maintenance:update:htaccess to update the htaccess. I get “.htaccess has been updated” as a response. But nothing happens.

Log entries

My only Log entries are “Login failed” ones.

Configuration

Nextcloud

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "30.0.6.2",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "auth.bruteforce.protection.enabled": false,
        "maintenance": false,
        "theme": "",
        "loglevel": 2,
        "htaccess.RewriteBase": "\/"
    }
}

Apps

Enabled:
  - activity: 3.0.0
  - calendar: 5.1.0
  - circles: 30.0.0
  - cloud_federation_api: 1.13.0
  - comments: 1.20.1
  - contactsinteraction: 1.11.0
  - dashboard: 7.10.0
  - dav: 1.31.1
  - federatedfilesharing: 1.20.0
  - federation: 1.20.0
  - files: 2.2.0
  - files_pdfviewer: 3.0.0
  - files_reminders: 1.3.0
  - files_sharing: 1.22.0
  - files_trashbin: 1.20.1
  - files_versions: 1.23.0
  - firstrunwizard: 3.0.0
  - logreader: 3.0.0
  - lookup_server_connector: 1.18.0
  - nextcloud_announcements: 2.0.0
  - notifications: 3.0.0
  - oauth2: 1.18.1
  - password_policy: 2.0.0
  - photos: 3.0.2
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - recommendations: 3.0.0
  - related_resources: 1.5.0
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - spreed: 20.1.4
  - support: 2.0.0
  - survey_client: 2.0.0
  - systemtags: 1.20.0
  - tasks: 0.16.1
  - text: 4.1.0
  - theming: 2.6.0
  - twofactor_backupcodes: 1.19.0
  - updatenotification: 1.20.0
  - user_status: 1.10.0
  - viewer: 3.0.0
  - weather_status: 1.10.0
  - workflowengine: 2.12.0
Disabled:
  - admin_audit: 1.20.0
  - app_api: 4.0.6
  - bruteforcesettings: 3.0.0
  - contacts: 7.0.0
  - encryption: 2.18.0
  - files_downloadlimit: 3.0.0
  - files_external: 1.22.0
  - mail: 4.2.0
  - notes: 4.11.0
  - richdocuments: 8.5.3
  - suspicious_login: 8.0.0
  - twofactor_nextcloud_notification: 4.0.0
  - twofactor_totp: 12.0.0-dev
  - user_ldap: 1.21.0
  - webhook_listeners: 1.1.0-dev

If you need any additional information, please let me know.

Several Apache modules have to be enabled too. See Installation: Pretty URLs.

yea, i know, i followed the docs, but it still doesnt work. Thats why i’m asking here…

okay, i just needed to update my apache config. the Require all granted and AllowOverride All was only in the http section, not in the one with ssl.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.