Discussion: Subdomains and DNS
Afficher un message
Vieux 01/10/2005, 14h17   #2
Klaus Johannes Rusch
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Subdomains and DNS

EOZyo wrote:

> My site hosts music and I would like to set subdomains for each
> language, i.e. english.mydomain.com which goes to
> www.mydomain.com/english


> The configuration I have typed in apache for this, it's almost the same
> configuration I've found almost everywhere, which is the following:
>
> Listen 80
>
> ServerName localhost:80


Add NameVirtualHost <ipaddress>

>
> <VirtualHost <ipaddress>>
> ServerAlias www.mydomain.com
> DocumentRoot "/www"
> ServerName www.mydomain.com
> </VirtualHost>
>
> <VirtualHost <ipaddress>>
> DocumentRoot "/www/english"
> ServerName english.mydomain.com
> ServerAlias english.mydomain.com
> </VirtualHost>



The way you have set this up currently, english.mydomain.com does not
redirect to www.mydomain.com/english but simply maps this to a different
content root.

As long as you use relative links in the content only that will work
okay, but as soon as you have something like <a href="/">Home</a> this
will work differently on english.mydomain.com and www.mydomain.com.

If you want english.mydomain.com only as an alias, add

Redirect / http://www.mydomain.com/english/

--
Klaus Johannes Rusch
KlausRusch@atmedia.net
http://www.atmedia.net/KlausRusch/
  Réponse avec citation
 
Page generated in 0,06118 seconds with 9 queries