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

**URL:** <https://help.nextcloud.com/t/apache-cant-remove-index-php-from-my-url/218402>\
**Category:** ℹ️ Support\
**Tags:** nc30, htaccess, apache\
**Created:** [February 26, 2025, 7:17am UTC](https://help.nextcloud.com/t/apache-cant-remove-index-php-from-my-url/218402 "2025-02-26T07:17:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![filtastisch](https://help.nextcloud.com/user_avatar/help.nextcloud.com/filtastisch/32/69490_2.png) [@filtastisch](https://help.nextcloud.com/u/filtastisch)\
**Post date:** [February 26, 2025, 7:17am UTC](https://help.nextcloud.com/t/apache-cant-remove-index-php-from-my-url/218402/1 "2025-02-26T07:17:36Z")

</div>

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

```auto
{
    "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

```auto
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.

---

<div class="post-metadata">

**Author:** ![jtr](https://help.nextcloud.com/letter_avatar/jtr/32/5_5575768a8748004e209b776fc1b2916d.png) [@jtr](https://help.nextcloud.com/u/jtr)\
**Post date:** [February 26, 2025, 2:27pm UTC](https://help.nextcloud.com/t/apache-cant-remove-index-php-from-my-url/218402/2 "2025-02-26T14:27:02Z")

</div>

Several Apache modules have to be enabled too. See [Installation: Pretty URLs](https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#pretty-urls).

---

<div class="post-metadata">

**Author:** ![filtastisch](https://help.nextcloud.com/user_avatar/help.nextcloud.com/filtastisch/32/69490_2.png) [@filtastisch](https://help.nextcloud.com/u/filtastisch)\
**Post date:** [March 2, 2025, 2:08pm UTC](https://help.nextcloud.com/t/apache-cant-remove-index-php-from-my-url/218402/3 "2025-03-02T14:08:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![filtastisch](https://help.nextcloud.com/user_avatar/help.nextcloud.com/filtastisch/32/69490_2.png) [@filtastisch](https://help.nextcloud.com/u/filtastisch)\
**Post date:** [March 2, 2025, 2:18pm UTC](https://help.nextcloud.com/t/apache-cant-remove-index-php-from-my-url/218402/4 "2025-03-02T14:18:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [March 10, 2025, 2:18pm UTC](https://help.nextcloud.com/t/apache-cant-remove-index-php-from-my-url/218402/5 "2025-03-10T14:18:57Z")

</div>

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