Meta tag depending of selected language and title
Posted
by lena
on Stack Overflow
See other posts from Stack Overflow
or by lena
Published on 2010-04-18T14:32:42Z
Indexed on
2010/04/18
15:03 UTC
Read the original article
Hit count: 265
Hi,
I'm aware about Google ignore most of the time, meta tag and use content. (This is not the point here)
I'm working on an existing web site, not created by me. I need a quick solution, I guess with variables.
The website construction: (no known template system)
index.html which is presentation page with language selection
index.php which embeding menu, content, footer several content pages that are embedded by index.php
What I need to do only for those 2 pages welcome_en.html and welcome_fr.html (these pages are embedded so no header possible on these page) to have different page title (browser title) and different META tag.
Any solution is welcome
Thanks
extra information
Language detection on index.php:
<?php
$lang = $_GET['lang']; $page = $_GET['page']; if ($_GET['page'] == "" || !$_GET['page']) { $page = "welcome"; } if ($_GET['lang'] == "" || !$_GET['lang']) { $lang = "_fr"; } ?>
<td><img src="images/ban02<?php echo "$lang" ?>.jpg" width="531" height="60" <?php if ($_GET['lang'] == "_fr" || $_GET['lang'] == "" || !$_GET['lang']) { echo "alt='text'";} else if ($_GET['lang'] == "_en") {echo "alt='text'"; } ?>></td>
for the embeded menu, footer ect like this one
<?php include "menu.php";
?>
for the embedded content
<?php
//echo "$page$lang.html";
$lang = preg_replace('/[^a-z0-9_ ]/i', '', $_GET['lang']);
$page = preg_replace('/[^a-z0-9_ ]/i', '', $_GET['page']);
include $page . $lang . ".html";
?>
© Stack Overflow or respective owner