Unintended redirects from Dispatcher virtual host configuration

This article describes how to resolve unexpected redirects when accessing an AEM as a Cloud Service publish URL, which are caused by Dispatcher virtual host configurations with overly broad ServerAlias entries.

Description description

Environment

  • Adobe Experience Manager (AEM) as a Cloud Service

Issue/Symptoms

  • Accessing the AEM publish URL redirects the browser to a different domain’s login page or homepage before any AEM content is served.
  • The redirect occurs consistently for all requests to the affected publish URL.

Cause

The issue is caused by Dispatcher virtual host configurations that use broad ServerAlias patterns (such as “.adobeaemcloud.com*” or “*.adobeaemcloud.net”) in a domain-specific virtual host. This causes requests for the AEM publish environment to be handled by the wrong virtual host, which contains rewrite rules that redirect to another domain.

Resolution resolution

To fix the unexpected redirects, follow these steps:

  1. Identify the affected virtual host configuration:

    • Review your Dispatcher configuration files, typically located in conf.d/available_vhosts/.

    • Look for virtual hosts that include broad ServerAlias entries such as:

      • "127.0.0.1"
      • "localhost"
      • "*.local"
      • "*.adobeaemcloud.com"
      • "*.adobeaemcloud.net"
    • Check if these aliases are present in a domain-specific vhost.

  2. Update the domain-specific virtual host:

    • Remove any broad ServerAlias entries from the virtual host that only handles a specific domain.
    • Configure ServerName to match only the intended domain and don’t include aliases for AEM Cloud or internal addresses.
  3. Create a dedicated virtual host for AEM Cloud and internal requests:

    • Create a separate vhost (based on the AEM Cloud default publish vhost) to handle local and Adobe Cloud aliases.

      • ServerName "publish"
      • ServerAlias "127.0.0.1" "localhost" "*.local" "*.adobeaemcloud.com" "*.adobeaemcloud.net"
      • DocumentRoot set appropriately (e.g., ${DOCROOT}).
    • Ensure this vhost doesn’t contain rewrite rules that redirect to other domains or handle paths not intended for AEM publish.

    • Enable the new vhost in your Dispatcher configuration (e.g., by linking it in conf.d/enabled_vhosts).

    • Don’t modify the immutable default.vhost file directly.

  4. Deploy and verify:

    • Deploy the updated Dispatcher configuration.
    • Access your AEM publish URL and confirm that it no longer redirects to another domain or login page.
recommendation-more-help
experience-cloud-kcs-help-kbarticles