2
2 Comments

Today I learned how to build a dual-language landing page

Today, I built an English and a German landing page for my new product Yes But Not For Long, using good old Apache behind nginx.

The Apache web server delivers the correct version of the page automatically, depending on the visitor's browser language setting. Additionally, the visitor can switch manually between English and German with one click.

It wasn't easy to figure out the correct settings for .htaccess and index.html.var so that index.en.html and index.de.html are selected correctly.

.htaccess

AddHandler type-map .var
MultiviewsMatch Any

Options +MultiViews

DirectoryIndex index.html.var

LanguagePriority en de
ForceLanguagePriority Fallback

index.html.var

URI: index.html

Content-language: en
Content-type: text/html
URI: index.en.html

Content-language: de, de-de, de-at, de-ch, de-li, de-lu
Content-type: text/html
URI: index.de.html

Result

https://yesbutnotforlong.com

I always love to get questions and feedback here. And, oh yes, sign-ups are also welcome, of course! 😎👋✅

  1. 1

    OK, and today I learnt about hreflang and canonicalization to have correct settings for SEO. See these pages here:

  2. 1

    Slick. I've been using content management systems so long it's nice to see how this is implemented and supported via htaccess and browser language settings. :thumbsup:

Trending on Indie Hackers
Getting first 908 Paid Signups by Spending $353 ONLY. 24 comments I talked to 8 SaaS founders, these are the most common SaaS tools they use 20 comments What are your cold outreach conversion rates? Top 3 Metrics And Benchmarks To Track 19 comments How I Sourced 60% of Customers From Linkedin, Organically 12 comments Hero Section Copywriting Framework that Converts 3x 12 comments Join our AI video tool demo, get a cool video back! 12 comments