I'm writing multilingual website. I have several files on server like:
/index.php
/files.php
/funny.php
And would like to add language support by placing language code into URL like this:
http://mywebsite/en/index.php
would redirect to:
http://mywebsite/index.php?lang=en
And
http://mywebsite/en/files.php
would redirect to:
http://mywebsite/files.php?lang=en
I would like to put more languages for example:
http://mywebsite/ch-ZH/index.php
And I would like this to work only for files with php and php5 extension. Rest of files should be the same as they are.
So for example when i will go to address
http://mywebsite/ch-ZH/index.php
I would like my PHP to recognize that current path is
http://mywebsite
and NOT
http://mywebsite/ch-ZH
It's necessary for me because in my PHP code I relate on current path and would like them to work as they are working now.
Could you please write how to prepare htaccess file on Apache to meet this criteria?