English 中文(简体)
SEO of multi-language website
原标题:

i am building a website with a multi-language feature.

it would be hard if each of the pages are to be created manually for each language so instead, i have different php files for each language containing define() statements like

<?php
    define("hello", HELLO);
    define ("there", THERE);
?>

and the webpages will only contain constants in between the HTML tags like

    <h1><?php echo HELLO; ?></h1>
    <h2><?php echo THERE; ?></h2>

and depending on the language choice of the user, the language php file (en.php, fr.php..) will be included in the page.

by default, the en.php (english text) will be the included file.

i m not sure about this but will search engines still be able to index the page? like it would see the english text and not just the constants?

also, is there a way so that the other translations will also be indexed?

thanks!

最佳回答

Search engines see what the users see (as long as you re not putting texts in images or something like that). To ensure that the whole site gets indexed, including all the different language versions, create a sitemap.

问题回答

The search engines are crawling your website like a normal user, they won t be able to see the constants. Those defines are on server side and cannot be access by search engines.

Also I advise you to take a look Zend_Translate, I think it would be a bit more flexible then building define.





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签