This thread is resolved. Here is a description of the problem and solution.
Problem:
You need to redirect the root URL of your website to a language-specific version using WPML, but you are unable to create a template for the redirection.
Solution:
1. First, create a PHP template in your site’s theme folder. You can name it 'Root redirect'. It's recommended to add PHP files to a child theme. For more details on creating custom page templates, visit Creating Custom Page Templates for Global Use.
2. Add the following content to your new PHP page template file:
<?php /* Template Name: Root redirect */ wp_redirect( home_url() ); exit; ?>
3. Edit your root page and in the right sidebar, expand the Summary section and select the template you just created.
4. Update the page.
If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we recommend opening a new support ticket. Also, check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. For further assistance, please visit our support forum at WPML Support Forum.
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 5 replies, has 2 voices.
Last updated by 3 months, 1 week ago.
Assisted by: Andrey.