How do I redirect to another page?
-
I have the Gengo plugin working so I have my site in English and French, works perfect. The problem is the menu links are still in English because they’re coded into the header.php page. So what I did was create a /fr directory and install another copy of WordPress here with the same config.php file so it accesses the same database. It’s the same site with Gengo installed and a French menu. So now I have the English install with English menu and Gengo working for a French/English site. Then I have the /fr directory with the French version installed, the French menu, and Gengo translating this one to English and French. That means I have 2 WordPress installs and 4 languages….2 English and 2 French. When the user comes to the site, it’s all in english with /?language=en at the end. When they click the French link, it brings them to /fr/?language=fr with all French content and French menu.
To try and not confuse you, I’m using the English side of the English menu site and the French side of the French menu site and leaving the English/French and French/English sides alone. But if you close the page while in French, and visit again, it brings you to the French side of the English install meaning it’s all in French but there’s English menu items.
My question is this…….if they reach 1 of the 2 areas they shouldn’t be in where English and French are mixed, is there a way to take the language variable from the URL and check to see if it is en or fr and redirect accordingly? I’m using
<?php $language = $_GET['language']; if ($language = "erewd") : header( 'Location: https://www.em2ab.com/index.html' ) ; endif; ?>
but it just redirects everytime no matter what the language variable is. Did I confuse you? Can anyone help?
- The topic ‘How do I redirect to another page?’ is closed to new replies.