WPML
Status
Resolved
Reported for
WPML Multilingual CMS 4.6.7
Resolved in
WPML 4.6.8
Topic tags
Bug

Overview of the issue

If you are using WPML with the Use directory for default language option enabled, you might encounter an issue with redirects.

Normally, accessing a URL like http://example.com/test/ should redirect to http://example.com/en/test/ (with the language folder added). However, this redirection does not occur.

Workaround

Please, make sure of having a full backup of your site before proceeding.


  • Open …/wp-content/plugins/sitepress-multilingual-cms/classes/canonicals/class-wpml-canonicals-hooks.php file.

  • Look for line 58.

  • Change:
    			if ( is_string( $install_subdir ) && 0 !== strpos( $actual_uri, '/' . $lang ) ) {


  • For:
    			if ( 0 !== strpos( $actual_uri, '/' . $lang ) ) {

All known issues →