Skip to content

[Bug]: Doesn't work correctly when server is under a URI (/nextcloud) AND .htaccess and pretty URL are active #64639

Description

@avibrazil

⚠️ This issue respects the following points: ⚠️

  • This is not a troubleshooting question, general support matter, or webserver/proxy problem, but likely a bug (if unsure, ask the Community Help Forum).
  • This issue is not already reported on Github OR solved at the Community Help Forum (I've searched!).
  • I'm using a maintained major version of Nextcloud Server and tested against the latest patch level. (Supported major versions and current patch levels).
  • I agree to follow Nextcloud's Code of Conduct.
  • I've tried my best to provide clear reproduction steps that someone unfamiliar with this bug could use to reproduce it.

Bug description

Works well when under a URI (http://server/nextcloud). But when I try to activate pretty URLs with .htaccess, many things break:

  • missing backgrounds
  • can't login: I see many error 404 in browser console, but those URLs seem to work when accessed individualy
  • can't login with device: I see error 405 in console for POST in URL http://server/nextcloud/login/webauthn/start
  • if I activate .htaccess while already logged in, the pages come without style, ugly typefaces, white background, bad layout

Steps to reproduce

  1. Use Fedora official packages, which install Nextcloud under /nextcloud
  2. Activate .htaccess and pretty URLs
  3. Access server

Expected behavior

I expected that index.php simply disappears from URLs

Nextcloud Server version

34

Operating system

Other

PHP engine version

PHP 8.4

Web server

Apache (supported)

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

No response

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

# (cd /usr/share/nextcloud; runuser -u apache -- ./occ config:list system)
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "version": "34.0.3.2",
        "dbtype": "pgsql",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "mail_smtpmode": "sendmail",
        "mail_sendmailmode": "pipe",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "ssl",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "opcache.revalidate_freq": 60,
        "opcache.jit": 1255,
        "opcache.jit_buffer_size": "128M",
        "default_phone_region": "BR",
        "bulkupload.enabled": true,
        "updatechecker": false,
        "check_for_working_htaccess": true,
        "asset-pipeline.enabled": false,
        "trusted_domains": [
            "server.local",
            "localhost"
        ],
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\OpenDocument",
            "OC\\Preview\\Krita",
            "OC\\Preview\\HEIC",
            "OC\\Preview\\Movie",
            "OC\\Preview\\SVG"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "assetdirectory": "\/var\/lib\/nextcloud",
        "htaccess.RewriteBase": "\/nextcloud",
        "overwrite.cli.url": "https:\/\/cloud.homeavi.alkalay.net:444\/nextcloud",
        "preview_libreoffice_path": "\/usr\/bin\/libreoffice",
        "apps_paths": [
            {
                "path": "\/usr\/share\/nextcloud\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/lib\/nextcloud\/apps",
                "url": "\/apps-appstore",
                "writable": true
            }
        ],
        "log_type": "syslog",
        "syslog_tag": "Nextcloud",
        "logfile": "",
        "loglevel": 2,
        "theme": "",
        "ncd_admin_settings": {
            "ncd_aria2_binary": "\/usr\/bin\/aria2c",
            "ncd_yt_binary": "\/usr\/bin\/yt-dlp",
            "focusVisibleAdded": ""
        },
        "mail_smtpport": "465",
        "app_install_overwrite": [
            "nextbackup",
            "news"
        ],
        "global_aria2_config": [],
        "filelocking.enabled": true,
        "memories.exiftool_no_local": true,
        "memories.vod.path": "\/var\/lib\/nextcloud\/apps\/memories\/bin-ext\/go-vod-amd64",
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "memories.db.triggers.fcu": true,
        "csrf.optout": [
            "\/^.*nextcloudcmd.*\/",
            "\/^.*Nextcloud.*\/"
        ],
        "twofactor_enforced": "false",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "config_preset": 2
    }
}

List of activated Apps

# (cd /usr/share/nextcloud; runuser -u apache -- ./occ app:list)
Enabled:
  - activity: 7.0.0
  - admin_audit: 1.24.0
  - app_api: 34.0.0
  - appstore: 1.0.0
  - bruteforcesettings: 7.0.0
  - cloud_federation_api: 1.18.0
  - comments: 1.24.0
  - dashboard: 7.14.0
  - dav: 1.40.0
  - federatedfilesharing: 1.24.0
  - federation: 1.24.0
  - files: 2.6.0
  - files_downloadlimit: 5.2.0
  - files_external: 1.26.0
  - files_lock: 34.0.1
  - files_pdfviewer: 7.0.0-dev.0
  - files_reminders: 1.7.0
  - files_sharing: 1.26.0
  - files_trashbin: 1.24.0
  - files_versions: 1.27.0
  - firstrunwizard: 7.0.0-dev.0
  - groupfolders: 22.0.6
  - guests: 4.9.0
  - impersonate: 5.0.0
  - logreader: 7.0.0
  - lookup_server_connector: 1.22.0
  - news: 28.7.0
  - nextcloud_announcements: 6.0.0
  - notifications: 7.0.0-dev.1
  - oauth2: 1.22.0
  - office: 1.0.0
  - oidc: 2.0.9
  - passwords: 2026.7.20
  - photos: 7.0.0
  - profile: 1.3.0
  - provisioning_api: 1.24.0
  - related_resources: 5.0.0-dev.0
  - serverinfo: 6.0.0
  - settings: 1.17.0
  - survey_client: 6.0.0-dev.0
  - text: 8.0.0
  - theming: 2.9.0
  - twofactor_backupcodes: 1.23.0
  - twofactor_totp: 16.0.0
  - twofactor_webauthn: 2.7.0
  - user_migration: 10.5.0
  - user_status: 1.14.0
  - viewer: 7.0.0-dev.0
  - weather_status: 1.14.0
  - webhook_listeners: 1.6.0
  - workflowengine: 2.16.0
Disabled:
  - circles: 34.0.0 (installed 24.0.1)
  - contactsinteraction: 1.15.0 (installed 1.5.0)
  - encryption: 2.22.0
  - password_policy: 6.0.0-dev.0 (installed 1.14.0)
  - privacy: 6.0.0-dev.1 (installed 1.8.0)
  - recommendations: 7.0.0 (installed 1.3.0)
  - sharebymail: 1.24.0 (installed 1.14.0)
  - support: 6.0.0 (installed 1.5.0)
  - suspicious_login: 12.0.0-dev.0
  - systemtags: 1.24.0 (installed 1.14.0)
  - twofactor_nextcloud_notification: 8.0.0
  - updatenotification: 1.24.0 (installed 1.14.0)
  - user_ldap: 1.25.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

Additional info

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmap34-feedbackbug

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions