I have a small portfolio landing page based on js/css/html. No frameworks/CMS, just pure static html. Entry point is index.html
file with content on English language.
I want to use translations on my site: index.ru.html
, index.ua.html
, but I don't want to see any *.html
or index.ua
in the address bar. User can change a language by buttons on top of my page.
How can I route:
http://mysite/en
to display index.html
- first enter to sitehttp://mysite/ru
to display index.ru.html
http://mysite/ua
to display index.ua.html
?
Also can I route to specific div/section html tag: user enter http://mysite/ru/contacts
to display contacts section in index.ru.html
? Scrolling page also must change url... is it real or not?
Maybe I need to use micro-framework for my small needs?
EDIT:
Found good example on this site - http://www.even.lv/
Try adding this to your Root/.htaccess :
RewriteEngine On
RewriteBase /
RewriteRule ^en/?$ index.html [NC,L]
RewriteRule ^(ru|ua)$ index.$1.html [NC,L]
This will redirect "/en" to "/index.html" and "/ru" to "index.ru.html".