I have a very basic PHP website that is currently setup for two languages like so:
lang.en.php - English strings
lang.es.php - Espanol strings
en/ - folder with PHP pages (PHP first processes the URL and loads the appropriate strings - in this case, lang.en.php); files are EXACTLY the same as en/
es/ - folder with PHP pages (PHP first processes the URL and loads the appropriate strings - in this case, lang.es.php); files are EXACTLY the same as es/
index.php - redirects the user to the appropriate sub-directory based on the user's browser language
This seems to work fine for both SEO and easy management, except for the file duplication in the en/ and es/ folders. If I ever want to update/add a page, I have to upload the same file to both en/ and es/. Is there a way to have the en/ and es/ folders pull the same files from say, a common/ folder? I would like to keep the en/ and es/ directories because it's user friendly and, from my understanding, good for SEO.
Any help would be much appreciated!
EDIT: I've considered using a GET variable for the language (ie. ?lang=en) which would solve my issue of duplication and allow me to replace the directories en/ and es/ with a common directory for all languages in which each page's language is determined by the lang variable. However, would this be bad for SEO?