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_endpoint
or adding rewrite rules via add_filter('rewrite_rules_array')
, using preg_match
to 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
Post a Comment