My website will be in 3 languages. French (fr) is the default language. The structure of the site is the following:
Root directory (note: I'm not using php files, just plain html)
/fr/
Index.html
About-us.html
Contact.html
/en/
Index.html
About-us.html
Contact.html
/de/
Index.html
About-us.html
Contact.html
I got questions:
Super easy tool here:
http://www.htaccesstools.com/redirection-by-language/
Makes life incredibly easy for htaccess redirects based on the browser's language.
Example:
RewriteEngine on
RewriteCond %{HTTP:Accept-Language} (fr) [NC]
RewriteRule .* /fr/index.html [L]
RewriteCond %{HTTP:Accept-Language} (en) [NC]
RewriteRule .* /en/index.html [L]
RewriteCond %{HTTP:Accept-Language} (de) [NC]
RewriteRule .* /de/index.html [L]
This is a hard redirect, the browser's location bar will indeed show the new page. Though, this is better for UX than an internal redirect masking the URL.
To answer your question, it is highly regarded that an index.html provides the best UX. However, that's essentially because people have come to expect this in general (website.com/en/, website.com/fr/, etc.). SEO-wise, no, you wouldn't get dinged if you didn't follow that same structure.
Best practice is to use your best guess (like the htaccess), and still offer a menu for switching languages. Plus, you'll also need a fallback for if the Accept-Language isn't actually defined (like going to /en/ by default). This could be a final line in the htaccess, or it could simply be an index.html
at the root level, where .htaccess
is.
Other than that, there's not a tremendous amount that goes into localization.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With