|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="UTF-8"> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | + <title>Documentation Redirect</title> |
| 7 | + |
| 8 | +</head> |
| 9 | +<body> |
| 10 | + <h1>Redirecting to documentation...</h1> |
| 11 | + <p>If you are not redirected automatically, enable JavaScript in your browser.</p> |
| 12 | + |
| 13 | + <script> |
| 14 | + // Mapping from the original PHP file |
| 15 | + const mapping = { |
| 16 | + 'admin': '/admin_manual', |
| 17 | + 'admin-2fa': '/admin_manual/configuration_user/two_factor-auth.html', |
| 18 | + 'admin-antivirus-configuration': '/admin_manual/configuration_server/antivirus_configuration.html', |
| 19 | + 'admin-background-jobs': '/admin_manual/configuration_server/background_jobs_configuration.html', |
| 20 | + 'admin-backup': '/admin_manual/maintenance/backup.html', |
| 21 | + 'admin-big-file-upload': '/admin_manual/configuration_files/big_file_upload_configuration.html', |
| 22 | + 'admin-bigint-conversion': '/admin_manual/configuration_database/bigint_identifiers.html', |
| 23 | + 'admin-cache': '/admin_manual/configuration_server/caching_configuration.html', |
| 24 | + 'admin-code-integrity': '/admin_manual/issues/code_signing.html', |
| 25 | + 'admin-config': '/admin_manual/configuration_server/config_sample_php_parameters.html', |
| 26 | + 'admin-db-configuration': '/admin_manual/configuration_database/linux_database_configuration.html', |
| 27 | + 'admin-db-conversion': '/admin_manual/configuration_database/db_conversion.html', |
| 28 | + 'admin-db-transaction': '/admin_manual/configuration_database/linux_database_configuration.html#database-read-committed-transaction-isolation-level', |
| 29 | + 'admin-delegation': '/admin_manual/configuration_server/admin_delegation_configuration.html', |
| 30 | + 'admin-deploy-options': '/admin_manual/exapps_management/AdvancedDeployOptions.html', |
| 31 | + 'admin-email': '/admin_manual/configuration_server/email_configuration.html', |
| 32 | + 'admin-encryption': '/admin_manual/configuration_files/encryption_configuration.html', |
| 33 | + 'admin-external-storage': '/admin_manual/configuration_files/external_storage_configuration_gui.html', |
| 34 | + 'admin-files-access-control': '/admin_manual/file_workflows/access_control.html', |
| 35 | + 'admin-files-automated-tagging': '/admin_manual/file_workflows/automated_tagging.html', |
| 36 | + 'admin-files-retention': '/admin_manual/file_workflows/retention.html', |
| 37 | + 'admin-groupware-oauth-microsoft': '/admin_manual/groupware/mail.html#xoauth2-authentication-with-microsoft-azure-ad', |
| 38 | + 'admin-install': '/admin_manual/installation/index.html', |
| 39 | + 'admin-ldap': '/admin_manual/configuration_user/user_auth_ldap.html', |
| 40 | + 'admin-logging': '/admin_manual/configuration_server/logging_configuration.html', |
| 41 | + 'admin-long-running-migration-steps': '/admin_manual/maintenance/upgrade.html#long-running-migration-steps', |
| 42 | + 'admin-mysql-utf8mb4': '/admin_manual/configuration_database/mysql_4byte_support.html', |
| 43 | + 'admin-nginx': '/admin_manual/installation/nginx.html', |
| 44 | + 'admin-oauth2': '/admin_manual/configuration_server/oauth2.html', |
| 45 | + 'admin-performance': '/admin_manual/installation/server_tuning.html', |
| 46 | + 'admin-php-fpm': '/admin_manual/installation/source_installation.html#php-fpm-tips-label', |
| 47 | + 'admin-php-modules': '/admin_manual/installation/php_configuration.html#required-php-modules', |
| 48 | + 'admin-php-opcache': '/admin_manual/installation/server_tuning.html#enable-php-opcache', |
| 49 | + 'admin-provisioning-api': '/admin_manual/configuration_user/user_provisioning_api.html', |
| 50 | + 'admin-reverse-proxy': '/admin_manual/configuration_server/reverse_proxy_configuration.html', |
| 51 | + 'admin-security': '/admin_manual/installation/harden_server.html', |
| 52 | + 'admin-setup-well-known-URL': '/admin_manual/issues/general_troubleshooting.html#service-discovery', |
| 53 | + 'admin-sharing': '/admin_manual/configuration_files/file_sharing_configuration.html', |
| 54 | + 'admin-sharing-federated': '/admin_manual/configuration_files/federated_cloud_sharing_configuration.html', |
| 55 | + 'admin-source_install': '/admin_manual/installation/source_installation.html', |
| 56 | + 'admin-sse-legacy-format': '/admin_manual/configuration_files/encryption_migration.html', |
| 57 | + 'admin-sso': '/admin_manual/configuration_server/sso_configuration.html', |
| 58 | + 'admin-system-requirements': '/admin_manual/installation/system_requirements.html', |
| 59 | + 'admin-theming': '/admin_manual/configuration_server/theming.html', |
| 60 | + 'admin-theming-icons': '/admin_manual/configuration_server/theming.html#theming-of-icons', |
| 61 | + 'admin-transactional-locking': '/admin_manual/configuration_files/files_locking_transactional.html', |
| 62 | + 'admin-trusted-domains': '/admin_manual/installation/installation_wizard.html#trusted-domains', |
| 63 | + 'admin-update': '/admin_manual/maintenance/update.html', |
| 64 | + 'admin-warnings': '/admin_manual/configuration_server/security_setup_warnings.html', |
| 65 | + 'admin-windows-compatible-filenames': '/admin_manual/configuration_files/windows_compatible_filenames.html', |
| 66 | + 'admin-workflowengine': '/admin_manual/file_workflows/index.html', |
| 67 | + 'admin-android-deep-link-handling': '/admin_manual/configuration_server/android_deep_link_handling.html', |
| 68 | + |
| 69 | + 'developer-manual': '/developer_manual', |
| 70 | + 'developer-backports': '/developer_manual/getting_started/development_process.html#bugfixes', |
| 71 | + 'developer-code-integrity': '/developer_manual/app_publishing_maintenance/code_signing.html', |
| 72 | + 'developer-css': '/developer_manual/html_css_design/css.html', |
| 73 | + 'developer-theming': '/developer_manual/basics/front-end/theming.html', |
| 74 | + |
| 75 | + // Please always include the en language code in the URL |
| 76 | + 'user': '/user_manual', |
| 77 | + 'user-2fa': '/user_manual/en/user_2fa.html', |
| 78 | + 'user-encryption': '/user_manual/en/files/encrypting_files.html', |
| 79 | + 'user-files': '/user_manual/en/files/index.html', |
| 80 | + 'user-manual': '/user_manual/en', |
| 81 | + 'user-sharing-federated': '/user_manual/en/files/federated_cloud_sharing.html', |
| 82 | + 'user-sync-calendars': '/user_manual/en/groupware/calendar.html', |
| 83 | + 'user-sync-contacts': '/user_manual/en/groupware/contacts.html', |
| 84 | + 'user-trashbin': '/user_manual/en/files/deleted_file_management.html', |
| 85 | + 'user-versions': '/user_manual/en/files/version_control.html', |
| 86 | + 'user-webdav': '/user_manual/en/files/access_webdav.html' |
| 87 | + } |
| 88 | + |
| 89 | + function getQueryParam(param) { |
| 90 | + const urlParams = new URLSearchParams(window.location.search) |
| 91 | + return urlParams.get(param) |
| 92 | + } |
| 93 | + |
| 94 | + function getPreferredLanguage() { |
| 95 | + const languages = navigator.languages || [navigator.language] |
| 96 | + const supportedLanguages = [ |
| 97 | + 'af', 'br', 'cs', 'de', 'el_GR', 'es', 'fi_FI', 'ga', 'hr', 'hu_HU', 'it', |
| 98 | + 'ko', 'nb_NO', 'nn', 'pt_BR', 'ro', 'si', 'sr', 'ta', 'tr', 'uz', 'zh_CN', |
| 99 | + 'zh_TW', 'ar', 'ca', 'da', 'el', 'eo', 'eu', 'fr', 'gl', 'hu', 'id', 'ja_JP', |
| 100 | + 'mn', 'nl', 'pl', 'pt_PT', 'ru', 'sk_SK', 'sq', 'sv', 'th', 'uk', 'vi', 'zh_HK', |
| 101 | + ] |
| 102 | + // Build a lowercase lookup map to canonical form for case-insensitive matching |
| 103 | + const supportedLower = supportedLanguages.map(l => l.toLowerCase()) |
| 104 | + |
| 105 | + for (const lang of languages) { |
| 106 | + const fullLang = lang.replace('-', '_'); // Normalize e.g. en-US → en_US |
| 107 | + const lowerFullLang = fullLang.toLowerCase() |
| 108 | + |
| 109 | + // Try full language code (e.g., en_US) — return canonical directory name |
| 110 | + const fullIdx = supportedLower.indexOf(lowerFullLang) |
| 111 | + if (fullIdx !== -1) { |
| 112 | + return supportedLanguages[fullIdx] |
| 113 | + } |
| 114 | + |
| 115 | + // Try base language code (e.g., en) — return canonical directory name |
| 116 | + const baseLang = lowerFullLang.split('_')[0] |
| 117 | + const baseIdx = supportedLower.indexOf(baseLang) |
| 118 | + if (baseIdx !== -1) { |
| 119 | + return supportedLanguages[baseIdx] |
| 120 | + } |
| 121 | + } |
| 122 | + |
| 123 | + return 'en'; // Default to English |
| 124 | + } |
| 125 | + |
| 126 | + |
| 127 | + function performRedirect() { |
| 128 | + const from = getQueryParam('to') |
| 129 | + const currentLocation = window.location |
| 130 | + const basePath = currentLocation.pathname.replace(/\/go\.php(\/.*)?$/, '') |
| 131 | + |
| 132 | + let subPath |
| 133 | + |
| 134 | + if (mapping[from]) { |
| 135 | + subPath = mapping[from] |
| 136 | + } else { |
| 137 | + // Prefix-based fallback to preserve legacy PHP redirect behavior |
| 138 | + if (from && from.startsWith('admin-')) { |
| 139 | + subPath = '/admin_manual' |
| 140 | + } else if (from && from.startsWith('developer-')) { |
| 141 | + subPath = '/developer_manual' |
| 142 | + } else { |
| 143 | + subPath = '/user_manual' |
| 144 | + } |
| 145 | + } |
| 146 | + |
| 147 | + // Handle user manual language detection |
| 148 | + if (subPath.startsWith('/user_manual')) { |
| 149 | + const preferredLang = getPreferredLanguage() |
| 150 | + const subPathParts = subPath.split('/') |
| 151 | + |
| 152 | + if (subPathParts.length >= 2 && subPathParts[1] === 'user_manual') { |
| 153 | + // Replace the language part with the preferred language |
| 154 | + subPathParts[2] = preferredLang |
| 155 | + } |
| 156 | + |
| 157 | + // Join the parts back together |
| 158 | + if (subPathParts.length > 2) { |
| 159 | + subPath = subPathParts.join('/') |
| 160 | + } |
| 161 | + } |
| 162 | + |
| 163 | + const redirectUrl = `${currentLocation.protocol}//${currentLocation.host}${basePath}${subPath}` |
| 164 | + |
| 165 | + // Perform the redirect |
| 166 | + window.location.href = redirectUrl |
| 167 | + } |
| 168 | + |
| 169 | + // Perform redirect when page loads |
| 170 | + window.onload = performRedirect |
| 171 | + </script> |
| 172 | +</body> |
| 173 | +</html> |
0 commit comments