We run a website that has an English version in the root directory http://www.mywebsite.com and a Czech version in a folder called ‘cs’ http://www.mywebsite.com/cs
With our previous website we handled both language versions in the root directory, but with English files as standard filenames (eg: index.php) and Czech files with an addition _cz appended to the filename (eg: index_.php. We then had two flag buttons at the top of the website so each language version of each specific page could be called on, the relevant part of the header code is this:
href="http://www.mywebsite.cz<?php echo str_replace('.', '_cz.', $_SERVER['PHP_SELF']);?>"
href="http://www.mywebsite.com<?php echo str_replace('_cz.', '.', $_SERVER['PHP_SELF']);?>"
So that’s the background. Our new website has pages created dynamically using CodeIgniter. We need to modify the above code so that when a user is on an English page (eg: http://www.mywebsite.com/home/signup) for the Czech flag button to show http://www.mywebsite.com/cs/home/signup
And then vice versa for the Czech pages – the cs/ will be removed from URL. Can you help by modifying the above code in a similar way to the original operation? Many thanks!
Update
If i understand correctly what you mean, maybe something like :