I have read a lot of answers here about changing the site language with jQuery but nothing worked for me.Well, I have a website as an example: www.domain.comInside I have folders for the languages. /en/ English pages, /el/ Greek pages.All pages are the same, both for English and Greek. index.html, gallery.html etcI have two flag icons in the top right header page to change the language.I want, when the user clicks the British flag, to go to \[code\]/en/page.html\[/code\] and when the user clicks the Greek flag to go to \[code\]/el/page.html\[/code\].\[code\]<script>$(document).ready(function(){ $('a').click(function() { document.location.href =http://stackoverflow.com/questions/13821118/document.location.href.replace('/el/' '/en/'); }); });</script>\[/code\]And here is my html code:\[code\]<head><a href="javascript:;"><img src="http://stackoverflow.com/questions/images/flagen.gif"></a></head>\[/code\]In this example I am on Greek page rootwww/el/index.htmland I want to replace /el/ with /en/ folder path and go to /en/index.htmlWhat I am doing wrong?