Thank you very much Derokorian, it was a great tip. I actually managed to do domain.com/en/content.php using .htaccess. I found a good article that guided me through:
I'll give the basics to the solution for future users, more information and possibilities can be found in the above link.
Let's say that that I have a page content.php in my website which I want to have in english and in french, and I would like to refer to the two versions of the page using the urls:
I only want to hold one PHP document called content.php on my server and use some translation tool to determine the actual text in the page. You can use smarty, gettext() or many other tools.
I place the single copy of content.php in my base directory (www.example.com/content.php), and then I create in that base directory an ".htaccess" file with the following code:
RewriteRule /?en/(.)$ $1?lang=en
RewriteRule /?fr/(.)$ $1?lang=fr [L]
What this code will do is translate www.example.com/en/content.php to www.example.com/content.php?lang=en, and similarly for "fr". Thus in both cases, the single content.php file is called but with a $_GET['lang'] variable which I can use to display the proper language. The viewer of the page, on the other hand, just sees the original url called, which was www.example.com/en/content.php.
You can also have subdirectories and it still works with the single .htaccess file you've created in your base. For example, www.example.com/en/dir/content2.php will call the file www.example.com/dir/content2.php?lang=en without any further changes.
Note - you must make sure that your server supports mod_rewrite. My server, for example, supports it but I had to add the following extra line to my .htaccess file:
You should find this information on your host's website.