Wordpress: Pre-path mode for a multilanguage solution ("/en/", "/de/") -


i need have pattern in url on whole website control language shown. pattern www.website.com/en/permalink should generate variable $lang="en".

i have tried different approaches add_rewrite_rule, add_rewrite_endpointor adding rewrite rules via add_filter('rewrite_rules_array') , using preg_matchto generate actual pattern $_server['request_uri']. had on plugins qtranslate need sourcecode complex me understand.

after all, dont understand how in way, best approach achieve this?

the language pattern has stay in url on whole page, in qtranslate, f.e. after clicking menu-link pattern has shown in url again.

the solution has seo-friendly.

if aren't confident doing this, quickest way wpml (wordpress multi-language) plug-in.


Comments

Popular posts from this blog

cron - how to properly run Python script with crontab on every system startup -

elasticsearch - Is the order of operations guaranteed in a bulk update? -

Slow performance first queries on SQL Azure -