This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Our next available supporter will start replying to tickets in about 8.97 hours from now. Thank you for your understanding.

This thread is resolved. Here is a description of the problem and solution.

Problem: Browsing the site causes random 404 pages on both languages. Changing Language URL Format from «Different languages in directories» to « Language name added as a parameter» fixes the problem, but that is not an option on the site.

Solution: In certain cases, the .htaccess may get overwritten with the language folder. However, this issue is not caused by WPML.

The exact cause and the workaround to solve it are described in the errata page.

Relevant Documentation: This errata seems to have solved the problem: https://wpml.org/errata/htaccess-is-rewritten-with-language-folder/

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by Gnist Design 1 year, 5 months ago.

Assigned support staff: Cristina.

Author Posts
April 27, 2018 at 12:24 pm #1859577

Gnist Design

Browsing the site causes random 404 pages on both default language (Norwegian) and English. The 404 page served is from the server, not WP.

In error.log there are lines like this:
# File not found [/usr/local/lsws/DEFAULT/html/en/index.php]

Changing Language URL Format from «Different languages in directories» to « Language name added as a parameter» fixes the problem, but is not a sollution, as it would require a huge job in rewriting template files.

Please advise!

April 30, 2018 at 10:26 am #1893939

Cristina

Hello Stian,

thanks for contacting us on this and sorry for any delays.

I just browser to your pages and the pages showed up correctly in both languages in directories, but some short time later it went back to languages in parameters.

From the settings in the debug log it seems as if there was a root page enabled at some point. Could you check that this setting is not active anymore if you are not using it? And that there is no cache or security plugin still trying to retrieve any root page if you are not using a directory for the default language?

Here is the line in the debug information: [root_page] => 534207

I understand that this problem is quite recent, so if the 404 errors are random and you see this file not found, there may be a problem here not related to the settings of WPML but to how the pages are retrieved from the server.

I see that you are using already PHP Version 7.2.3. and the LiteSpeed Server software.

The latest WPML releases came out shortly after the PHP update to version 7.2, so that there are some deprecated functions that WPML uses still. This could cause an issue on your site.

Could you please check if downgrading to PHP 7.1 solves the issues?

The update to full compatibility with PHP 7.2 will be ready in a future WPML update.

In case this does not solve it, I would need some information about the error to pass to the devs. It would be good if you can provide me the WordPress debug.log (not WPML debug informations).

To enable it, open your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:

define('WP_DEBUG', true);
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY',false);

In this case the errors will be saved to a debug.log log file inside the /wp-content/directory. If you can paste your debug.log to pastebin.com and provide me that link it would be great!

Kind regards,
Cristina

April 30, 2018 at 11:12 am #1894702

Gnist Design

This errata seems to have solved the problem:
https://wpml.org/errata/htaccess-is-rewritten-with-language-folder/