Indexing

rel="alternate"

The `rel="alternate"` HTML link attribute identifies an alternative version of the current page, commonly used with hreflang for multilingual sites and with media queries for mobile-specific URLs.

The `rel="alternate"` attribute has three primary uses: with `hreflang` for language/region variants (`<link rel="alternate" hreflang="fr" href="/fr/page">`), with `type` for alternate formats (`<link rel="alternate" type="application/rss+xml" href="/feed.xml">`), and with `media` for device-specific versions.

For multilingual sites, every page must have a complete set of `rel="alternate" hreflang` tags pointing to all language versions, including a self-referencing tag. Missing or asymmetric annotations cause Google to ignore them entirely.

In Next.js App Router, configure alternate links via `metadata.alternates`. For RSS feeds, canonical URLs, and language variants, this is the cleanest approach. Indxel validates that alternate links are properly configured and reciprocal.

Example

// Next.js App Router — alternates configuration
export const metadata = {
  alternates: {
    canonical: "https://indxel.com/glossary/rel-alternate",
    languages: {
      "en": "https://indxel.com/en/glossary/rel-alternate",
      "fr": "https://indxel.com/fr/glossary/rel-alternate",
    },
    types: {
      "application/rss+xml": "https://indxel.com/feed.xml",
    },
  },
};

Stop shipping broken SEO

Indxel validates your metadata, guards your CI/CD pipeline, and monitors indexation — so you never miss an SEO issue again.