diff --git a/public/app/features/alerting/unified/components/rules/RuleDetailsActionButtons.tsx b/public/app/features/alerting/unified/components/rules/RuleDetailsActionButtons.tsx index 1b36cccf071..aeca2d94e40 100644 --- a/public/app/features/alerting/unified/components/rules/RuleDetailsActionButtons.tsx +++ b/public/app/features/alerting/unified/components/rules/RuleDetailsActionButtons.tsx @@ -62,8 +62,10 @@ export const RuleDetailsActionButtons: FC = ({ rule, rulesSource }) => { const buildShareUrl = () => { if (isCloudRulesSource(rulesSource)) { + const { appUrl, appSubUrl } = config; + const baseUrl = appSubUrl !== '' ? `${appUrl}${appSubUrl}/` : config.appUrl; const ruleUrl = `${encodeURIComponent(rulesSource.name)}/${encodeURIComponent(rule.name)}`; - return `${config.appUrl}${config.appSubUrl}/alerting/${ruleUrl}/find`; + return `${baseUrl}alerting/${ruleUrl}/find`; } return window.location.href.split('?')[0];