2026-01-02 13:41:09 +00:00
|
|
|
# Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2023-03-10 12:07:00 +00:00
|
|
|
# rubocop:disable Lint/MissingCopEnableDirective
|
2019-06-04 03:40:48 +00:00
|
|
|
class KnowledgeBase
|
|
|
|
|
class ServerSnippetApache < ServerSnippet
|
|
|
|
|
def template_path
|
2022-06-14 08:23:56 +00:00
|
|
|
<<~ERB
|
|
|
|
|
# Add following lines to <VirtualHost> directive
|
|
|
|
|
RewriteEngine On
|
|
|
|
|
RewriteRule ^#{path}(.*) /help$1 [PT]
|
2019-06-04 03:40:48 +00:00
|
|
|
ERB
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def template_full
|
2022-06-14 08:23:56 +00:00
|
|
|
<<~ERB
|
|
|
|
|
# Add following lines to <VirtualHost> directive
|
|
|
|
|
RewriteEngine On
|
|
|
|
|
RewriteCond %{HTTP_HOST} #{host}
|
|
|
|
|
RewriteRule (assets|api)/(.*) /$1/$2 [PT]
|
|
|
|
|
RewriteCond %{HTTP_HOST} #{host}
|
|
|
|
|
RewriteRule #{path}(.*) /help$1 [PT]
|
2019-06-04 03:40:48 +00:00
|
|
|
ERB
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def template_original_url
|
2022-06-14 08:23:56 +00:00
|
|
|
<<~ERB
|
|
|
|
|
# Add following lines to <VirtualHost> directive, before ProxyPass
|
|
|
|
|
SetEnvIf Request_URI "(.*)" ORIGINAL_URL=$1
|
|
|
|
|
RequestHeader add X-ORIGINAL-URL %{ORIGINAL_URL}e
|
2019-06-04 03:40:48 +00:00
|
|
|
ERB
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|