Edge Delivery Services how-tos · updated

head.html and 404.html in an Edge Delivery Services project

head.html is injected into every page's head on the server and combined with metadata from the content. aem.live says it should stay largely unchanged from the boilerplate. A 404.html in the repository root replaces the body of the default not-found response for any URL that matches neither content nor code.

Legitimate reasons to change head.html

  • Remapping the project to a different base path when the site is served from a subfolder on your CDN.
  • Supporting legacy browsers that need non-module scripts.

Adding Adobe Web SDK, Google Tag Manager or other third-party scripts to head.html is strongly advised against for performance, as are inline scripts and styles. Load martech in the delayed phase instead.

Custom 404

Put 404.html in the repository root. It is served for any URL without content or code, and can reuse your site's header, footer and styles so visitors can navigate on. Add a search box or links to top sections.

Preview and live URLs

Every branch gets a preview site at https://<branch>--<repo>--<owner>.aem.page/ and a live site at .aem.live. The combined <branch>--<repo>--<owner> must not exceed 63 characters, and none of the three may contain --, because they form a subdomain.

FileChange it?Why
head.htmlRarelyEvery byte delays every page
404.htmlYesBetter recovery for broken links
scripts/scripts.jsYesAuto blocking, loading phases

How to do it

  1. Diff your head.html against the boilerplate and remove anything not needed.
  2. Move martech to the delayed phase.
  3. Create a root 404.html with navigation and search.
  4. Check branch names keep branch--repo--owner within 63 characters.

Related pages on this site

Questions

Can I add analytics to head.html?

aem.live strongly advises against it for performance; load analytics in the delayed phase.

Why does my branch preview URL not work?

Check that branch--repo--owner is 63 characters or fewer and that none of the names contain --.

Where does a custom 404 page go?

As 404.html in the root of the GitHub repository.

Sources

Facts about Adobe's platform are from the linked Adobe pages, checked 10 Nov 2026. Explanations and examples are ours unless marked as Adobe's.

Scan, Convert, Verify, Install

How Surge Migrate helps with a move to Edge Delivery Services

Surge Migrate moves a website from any CMS to any CMS, and Edge Delivery Services is one of the systems it writes. Pages are converted automatically, and you check the result before you install anything.

  1. 1

    Scan

    Names the system behind your site, counts pages and templates, lists the blocks to build and the work no tool does, and gives an effort range with its working.

    Scan a site →
  2. 2

    Convert

    Each page becomes an Edge Delivery document, an AEM Core Component page and import files for 7 other systems. 10 pages free; 500 or 2,000 pages in one paid run.

    Convert your pages →
  3. 3

    Verify

    A download is offered only when its own format check passes. The report lists every field not found and every component kept as plain content. Compare old and new pages side by side.

    Parity check →
  4. 4

    Install

    You import with the target system's own tool, on your own environment. Each download's README gives the command. Your system changes only when you run it.

    How each import was tested →

Import kit and one document per page, in the format of Adobe's AEM Importer. The free EDS block mapper shows which of your components map to EDS blocks. For AEM 6.5 code, the free readiness scan lists Cloud Service blockers in your browser. Nothing is uploaded.