Go Back   CodingForums.com > :: Client side development > General web building

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-16-2008, 03:04 PM   PM User | #1
AlexV
Regular Coder

 
AlexV's Avatar
 
Join Date: Oct 2008
Location: Near Montreal, Quebec - Canada.
Posts: 214
Thanks: 5
Thanked 22 Times in 22 Posts
AlexV is an unknown quantity at this point
Help with SEO for multilingual website

Hello all!

I made a multilingual PHP website framework. The framework serve the HTML "container" (the visual template of the site) and the page serve the content (in the current language).

I use the following to determine the current language:
1) $_GET['lang'] if set.
2) $_SESSION variable if set.
3) $_COOKIE if set.
4) Default language (English).

The user can change the language anytime on any page.

All the languages are in the same file. For example, index.php can be served in English, French, German...

This setup is very easy to maintain since if you change the visual template (the container), all the pages of the site will be updated at once. Same thing with the content... For example, you set the content layout of index.php once and then edit the content for each language.

My setup has one problem... It's not very SEO oriented (yet). Since www.foo.net/index.php can be served in many languages, Google and friends only index my pages in the default language.

Now I want to implement SEO URLs. So far my system support language overrides: if the session is set to French and that you type index.php?lang=en the page will be served in English instead of French.

I would like to use something like:
www.foo.net/en/index.php
www.foo.net/fr/index.php

I know it's doable with .htaccess (I think) but I would like to know how to do it... I would like to avoid redirect things since I don't want to "break" the back button.

Many thanks for your thoughts/hints!
AlexV is offline   Reply With Quote
Old 10-16-2008, 03:46 PM   PM User | #2
gnomeontherun
Senior Coder

 
gnomeontherun's Avatar
 
Join Date: Sep 2007
Location: Houston
Posts: 2,846
Thanks: 10
Thanked 238 Times in 229 Posts
gnomeontherun will become famous soon enoughgnomeontherun will become famous soon enough
http://www.skybyte.net/articles/mod_rewrite/

Here is a link with some information, I'm no expert with all of the ways to do it, but it should give you a start.
__________________
jeremy - gnomeontherun
Educated questions often get educated answers, and simple questions often get simple answers.
gnomeontherun is offline   Reply With Quote
Old 10-17-2008, 05:20 AM   PM User | #3
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
Quote:
Originally Posted by TheWolf1 View Post
Hello all!

I made a multilingual PHP website framework. The framework serve the HTML "container" (the visual template of the site) and the page serve the content (in the current language).
if you use apache this could help you:

http://httpd.apache.org/docs/2.2/con...gotiation.html

best regards
oesxyl is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:16 AM.


Advertisement
Log in to turn off these ads.