I have a very basic PHP website that is currently setup for two languages like so:lang.en.php - English stringslang.es.php - Espanol stringsen/ - folder with PHP pages (PHP first processes the URL and loads the appropriate strings - in this case, lang.en.php); files areEXACTLY 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 areEXACTLY the same as es/index.php - redirects the user to the appropriate sub-directory based on the user's browser languageThis 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?
Multilingual Support on a PHP Website
php;url;multilingual;language
Instead to redirect in the index.php file to the appropiate folder, do this:Load appropiate language file based on the user's browser language (a simple require).Instead of redirect the user to the folder, load (require) from the 'common' folder the file that user asked for.