diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2015-02-06 14:15:29 +0300 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2015-02-06 14:21:05 +0300 |
commit | 7b0095dfa9a2096ba16465fef7daae8d57d82a55 (patch) | |
tree | e3ebfa4852f562a59e3dc9caa87fda917b4391b3 /go.php | |
parent | 77e4891487252328031f3b7593f5a7850d803751 (diff) |
Redirect to a working doc page when the target is not found
Diffstat (limited to 'go.php')
-rw-r--r-- | go.php | 30 |
1 files changed, 16 insertions, 14 deletions
@@ -4,21 +4,22 @@ ############## Adjust when editing docs ################## $mapping = array( - 'admin-ldap' => '/admin_manual/configuration/user_auth_ldap.html', 'admin-dir_permissions' => '/admin_manual/installation/installation_wizard.html#setting-strong-directory-permissions', - 'admin-source_install' => '/admin_manual/installation/source_installation.html', - 'admin-install' => '/admin_manual/installation/index.html', 'admin-encryption' => '/admin_manual/configuration/encryption_configuration.html', 'admin-external-storage' => '/admin_manual/configuration/external_storage_configuration_gui.html', + 'admin-install' => '/admin_manual/installation/index.html', + 'admin-ldap' => '/admin_manual/configuration/user_auth_ldap.html', + 'admin-provisioning-api' => '/admin_manual/configuration/user_provisioning_api.html', + 'admin-source_install' => '/admin_manual/installation/source_installation.html', + 'user-encryption' => '/user_manual/files/encryption.html', + 'user-files' => '/user_manual/files/index.html', 'user-manual' => '/user_manual', - 'user-webdav' => '/user_manual/files/files.html', 'user-sync-calendars' => '/user_manual/pim/calendar.html#synchronising-calendars-with-caldav', 'user-sync-contacts' => '/user_manual/pim/contacts.html#keeping-your-addressbook-in-sync', - 'user-encryption' => '/user_manual/files/encryption.html', 'user-trashbin' => '/user_manual/files/deletedfiles.html', - 'user-files' => '/user_manual/files/index.html', - 'user-versions' => '/user_manual/files/versioncontrol.html' + 'user-versions' => '/user_manual/files/versioncontrol.html', + 'user-webdav' => '/user_manual/files/files.html', ); ############# Do not edit below this line ################# @@ -29,15 +30,16 @@ $port = $_SERVER['SERVER_PORT']; $port = ($port !== '80' && $port !== '443') ? ":$port" : ''; $name = $_SERVER['SERVER_NAME']; $path = dirname($_SERVER['REQUEST_URI']); +$location = "$proto://$name$port$path"; +header('HTTP/1.1 302 Moved Temporarily'); if (array_key_exists($from, $mapping)) { - $target = $mapping[$from]; + header('Location: ' . $location . $mapping[$from]); } else { - $target = ''; + if (strpos($from, 'admin-') === 0) { + header('Location: ' . $location . '/admin_manual'); + } else { + header('Location: ' . $location . '/user_manual'); + } } -$location = "$proto://$name$port$path$target"; - -header('HTTP/1.1 302 Moved Temporarily'); -header('Location: '.$location); - |