Subdomains as languages

Using a single web hosting account to host multiple sites

Subdomains as languages

Postby concepto » Mon Sep 04, 2006 4:04 am

Hello everybody,

I have mydomain.com in /html and subdomains in /html/en.mydomain.com and /html/de.mydomain.com, and they can't point to anywhere else.

Is possible that when I put en.mydomain.com, Apache shows a file from the parent directory (/html)? For example:

Code: Select all
RewriteCond %{HTTP_HOST} ^en\.mydomain\.com$
RewriteRule ^(.*)$ /../index.htm?lang=en


Something like that. Could it be possible? Is there any other way to do this?

Thanks in advance.
concepto
 
Posts: 1
Joined: Mon Sep 04, 2006 3:47 am

Postby richardk » Mon Sep 04, 2006 8:37 am

Is possible that when I put en.mydomain.com, Apache shows a file from the parent directory (/html)?

Mod_rewrite can't go below the domain/subdomains document root.

You can try this if you have mod_proxy:
Code: Select all
Options +FollowSymLinks

RewriteEnigne On

RewriteCond %{HTTP_HOST} ^en\.mydomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/index.htm?lang=en [P,L]


Or you'll have to use mod_rewrite in combination with a serverside scripting language, do you have PHP? What is the scripting in index.htm?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 54 guests

cron