Change middle of the header

Zobator

New Member
I'm building a multi-language site and I want to put buttons so you can go the the equivalent of the other language, if you don't like your current language.

so if I'm on www.mydomain.com/nl/page1 I would like to go to www.mydomain/en/page1

Instead of always changing the path to /en/page1 , /en/page2 or /en/page3 etc. I wondered if it's possible to change the language by just stating to look into another subdomain for the same file so I could just copy the same code on every page without having to customise every single button.

Is there a way so I can just say something like this:

<a href="/en/..."></a>

BTW: I hope this is the right place of posting. Just joined this board a couple of minutes ago :D
 
Last edited:

smoovo

New Member
You have two options, DB based content and folders based content.

DB Based
All the content saved in the database and placed in it's place on the page. While clicking on a flag (language link) it will change variable (you can use either sessions or cookies) that pulls the data of the new language.

This method saves size of websites and saves using different folders and pages. But, it's have to be a server side powered by database pages.

Folder Based
Each language has it's own folder (like you mentioned). While you clicking on a flag (language link) it will enter to this folder and open the main page (with server side language you can make it open the same page you redirected from). Inside the folder you don't need to use a different paths to your links, since you are inside the folder it will direct inside it.
 
Top