Simple HTML site internationalization with Apache RewritRule
I made a simple HTML site (single index.html page) with two buttons to switch between languages (IT<->EN). Italian index.html is in it subfolder, english index.html is in en subfolder. The buttons modify the URL by replacing /en/ with /it/ and viceversa, allowing to switch between the pages. Everything works fine in locale. Good.
On the server, I have this folder tree
Accessing www.mysite.com I get the blank index, as expected. Adding RewriteEngine On on the .htaccess and accessing www.mysite.com/public_html/it/index.html, I access the italian index and the language switch button works fine (in /en/index.html it works, too). Fine.
.htaccess (rules for rewriting)
index.html (a blank page)
What I want is that:
- www.mysite.com goes to italian index automatically, without displaying the complete url (www.mysite.com/public_html/it/index.html) but just the root (www.mysite.com) or at least the url without "public_html" (www.mysite.com/it/index.html)
- the language switching buttons must work
I managed to get point 1, so I go to italian index with URL that is just www.mysite.com, by adding this to .htaccess:
The proble is that with this the buttons won't work correctly (I suppose the problem is that there isn't actually any /it/ in the URL to switch with /en/). So I think I need a more "sophisticated" RewriteRule.
RewriteRule public_html/index.html public_html/it/index.html
Can anyone help me?