Configurar Apache HTTP para reescribir URLs antiguas de OpenKM
Si un documento contiene enlaces basados en una versión antigua de OpenKM, esos enlaces no funcionarán por defecto porque el formato ha cambiado.
Por ejemplo, un enlace en la versión 6.4 puede tener este aspecto “https://old.server.de/OpenKM/index.jsp?uuid=39448438-1f42-43fb-b33f-7b9ad5ac010c”; para adaptarse a la versión 7.1.x debería convertirse a “https://new.server.de/openkm/kcenter/#/browser/uuid/39448438-1f42-43fb-b33f-7b9ad5ac010c”.
Puede usar la funcionalidad mod_rewrite de Apache para convertir la URL antigua al nuevo formato; use la siguiente configuración como ejemplo.
<VirtualHost *:80> ServerName new.server.de RedirectMatch ^/$ /openkm
# WebSocket support - needs proxy-wstunnel ProxyPass /openkm/webSocket ws://127.0.0.1:8080/openkm/webSocket ProxyPassReverse /openkm/webSocket ws://127.0.0.1:8080/openkm/webSocket
ProxyPass /openkm ajp://127.0.0.1:8009/openkm keepalive=On ProxyPassReverse /openkm http://new.server.de/openkm
ErrorLog /var/log/apache2/openkm-error.log CustomLog /var/log/apache2/openkm-access.log combined
### sample configuration below ###
RewriteEngine on RewriteCond %{HTTP_HOST} ^old\.server\.de$ // if condition needed, not mandatory RewriteCond %{REQUEST_URI} ^\/OpenKM\/index\.jsp$ // if condition needed, not mandatory RewriteCond %{QUERY_STRING} ^uuid=([\s\S]*)$ // condition is mandatory, checks if URL comes with uuid and stores only uuid in the variable %1. RewriteRule ^.*$ https://new.server.de/openkm/kcenter/#/browser/uuid/%1 [NE,L] // NE-no-escape needed for hashtag, variable %1 with uuid added to the end.
###</VirtualHost>