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.
AddHandler type-map .var
MultiviewsMatch Any
Options +MultiViews
DirectoryIndex index.html.var
LanguagePriority en de
ForceLanguagePriority Fallback
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
I always love to get questions and feedback here. And, oh yes, sign-ups are also welcome, of course! 😎👋✅
OK, and today I learnt about
hreflang
and canonicalization to have correct settings for SEO. See these pages here: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: