I have a landing page that supports both English and Spanish. The dir is currently setup as so:
Folder
- index.html
- index-spanish.html
- other stuff
Each html file includes:
<link rel="alternate" href="https://www.example.com/" hreflang="en-def" />
<link rel="alternate" href="https://www.example.com/index-spanish.html" hreflang="es-def" />
From my understanding of hreflang, my Spanish html page should be served to the user if they have their language preference in their browser set to Spanish or by their IP (please correct me if I'm wrong).
The problem is, that isn't happening. So the question is, how can I get this setup to work and serve the correct page? Thanks in advance for all your help!
-Alec