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

Problem:
My homepage appearing blank but language directories work fine. I have the following error:

PHP Warning: include(): Failed opening 'xxx' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in xxx/sitepress-multilingual-cms/inc/request-handling/redirection/wpml-rootpage-redirect-by-subdir.class.php on line 47 

Solution:
1. Create a template page into your theme and call it for example page-root-redirect.php.
- Here, add the following code:

<?php
/*
Template Name: Root redirect
*/
wp_redirect( home_url() );
exit;
?>

This will redirect to your main language folder.

2. Now go to WPML -> Languages :
- Select 'Different languages in directories'
- Enable 'Use directory for default language'
- Select 'A page Create root page.'
- And assign the 'Root redirect' template for it.

Now, when you go to your main site, you'll be redirected to your main folder.
Remember to remove your cookies or try an incognito view.

Relevant Documentation:
https://wpml.org/documentation/getting-started-guide/language-setup/directory-default-language/

0% of people find this useful.

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.

This topic contains 3 replies, has 2 voices.

Last updated by Andrés 4 years, 3 months ago.

Assigned support staff: Andrés.

Author Posts
March 8, 2016 at 7:19 pm #833255

Nick

I am trying to:

Updated my WPML plugins and am experiencing issues with homepage appearing blank but language directories work except for the slider (Revoltion Slider)

URL of (my) website where problem appears:

hidden link

Directories:

hidden link
hidden link

I expected to see:

A redirection to the default language which is English

Instead, I got:

Blank page

Steps to duplicate the issue:

Visit the root URL i provided above, also I saw this in the PHP logs:

PHP Warning: include(): Failed opening '<em><u>hidden link</u></em>' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/vamcoacademy/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/request-handling/redirection/wpml-rootpage-redirect-by-subdir.class.php on line 47 

Thanks in advance,
Nick

March 9, 2016 at 10:19 am #833706

Andrés
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

Timezone: Europe/Paris (GMT+02:00)

Hello Nick,

Welcome to WPML support forum.

This is an expect behaviour when you are using 'Use directory for default language' option. So, if you want to be redirected to one of your folders, you need to manually implement the redirection.

1. Create a template page into your theme and call it for example page-root-redirect.php.
- Here, add the following code:

<?php
/*
Template Name: Root redirect
*/
wp_redirect( home_url() );
exit;
?>

This will redirect to your main language folder.

2. Now go to WPML -> Languages :
- Select 'Different languages in directories'
- Enable 'Use directory for default language'
- Select 'A page Create root page.'
- And assign the 'Root redirect' template for it.

Now, when you go to your main site, you'll be redirected to your main folder.
Remember to remove your cookies or try an incognito view.

Let me know if this works in your setup.

Best regards,
Andrés

March 9, 2016 at 4:54 pm #834143

Nick

Hello Andres,

Thanks for replying so quickly, this has resolved my issue! I'm just wondering why this has happened now? It never required this before the recent update, did you guys change it purposefully?

Regardless, Thanks!
Nick

March 10, 2016 at 9:42 am #834605

Andrés
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

Timezone: Europe/Paris (GMT+02:00)

I'm glad it solved it, Nick.
I can't tell if this is a new feature but I can tell you that it has been working for a year like this (since I'm here 🙂 ).
Have a nice day,
Andrés