Multilanguage site directory structure and coding

Hi I need to do a multilingual site.

I was thinking of having the following structure:

w.abc.com

/index.html
-/en/
-index.html
-corporate.html
-contact.html
-/fr/
-index.html
-corporatif.html
-contact.html

So the user will get to w.abc.com/index.html (in English by default) and be able to navigate either to pages in English or in French.

Now my problem is:

in w.abc.com/index.html file I would have to indicate:
<a href="en/corporate.html>
<a href="en/contact.html>
<a href=“fr/index.html”>

but in en/corporate.html> I would indicate:
<a href="corporate.html>
<a href="contact.html> as both files are in the same directory /en/

but how do I jump back to w.abc.com/index.html from en/corporate.html ? I can not just write:
<a href="index.html> as both files are not in the same directory.

Do I need to add a en/index.html file or is there a better way to handle this?
Same problem if I want to go back from fr/index.html to the root level w.abc.com/index.html

Thanks all for your help.

sebasforums

The safest way is just to use the absolute URL:

<a href="w.abc.com/index.html">

or just

<a href="w.abc.com/">

ok thx so much!

When I indicate:
<a href=“w.abc.com/index.html”> or <a href=“w.abc.com/”> in my computer’s version (not online) firefox can not locate the html file.

Will it work once in the server?

thx

Yes, it will work online but not locally. Sorry I didn’t mention that. Also, I probably should have given you this as the absolute URL:

<a href="[COLOR="Red"]http://[/COLOR]w.abc.com/index.html">

ok thx, I was wondering :slight_smile:

If you want it to work on your local machine (without using a local server environment like MAMP or WAMP), you could also do this, which will also work online:

<a href="http://www.sitepoint.com/forums/index.html">

The two dots with a slash (../) means “go up one folder and look for index.html”.