Forum Moderators: phranque

Message Too Old, No Replies

*.domain.com & test*.domain.com on 2 virtual servers?

How to use wildcards in such case?

         

sdelcampe

9:25 pm on Oct 7, 2006 (gmt 0)

10+ Year Member



Hello all,

We are searching for days how to do that.

We now have 8 subdomains for each domain name (9 different)... We will asap, for search engine optimization reasons, have more than 48 subdomains for each domain name.

We use a virtual server for our "live" site and one for our "test" site.

Structure is:
[*.domain.*...] = live sites
[test*.domain.*...] = test sites

In order to avoid writing more than 400 different possibilities, we would like to use wildcards in the serveralias directive.

But, it seems that *.domain.com takes priority over test*.domain.com... and the test site is never accessed.

Is there a easy solution for us?

Thanks a lot, Seb

jdMorgan

1:03 pm on Oct 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The simplest fix might be to change your naming convention to *.example.com and *.test.example.com

Jim

sdelcampe

7:52 pm on Oct 9, 2006 (gmt 0)

10+ Year Member



Hello Jim,

Thanks for your reply.

Unfortunately I need to know a little more as it does not seem to work for me.

in my config file of "live" virtual server, I added:
ServerAlias *.domain.com

in my config file of "test" virtual server, I added:
ServerAlias *.test.domain.com

But when I try [test.domain.com...] ... it brings me to the live site.

What's wrong? :-(

Is there a way to say the system to verify first if the domain matches *.test.domain.com before verifying if it matches *.domain.com?

Thanks, Sebastien

jdMorgan

1:18 pm on Oct 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd guess your Vhost declarations are not in the correct order. Put the most-specific (longest) ones first, followed by the shorter ones. The server will act on the first one it finds that matches, which seems to be what is happening in what you report.

Jim

sdelcampe

6:51 pm on Oct 12, 2006 (gmt 0)

10+ Year Member



Hi Jim,

It's ok now. vhosts conf files where included with a wildcard *... and were included in a->z order... i just changed their names to have my test virtual conf file before the production one.

Thanks, Seb