Share » Forums » General » How can i set *.mydomain.tld to...

How can i set *.mydomain.tld to access one specific site access?

How can i set *.mydomain.tld to access one specific site access?

Thursday 16 June 2011 5:46:01 am - 4 replies

Author Message

Damien MARTIN

Thursday 16 June 2011 6:31:16 am

Hi Ali,

You'll have to edit settings/override/site.ini.append.php

First be sure to have declared your siteaccess in [SiteSettings]

[SiteSettings]
DefaultAccess=the_default_siteaccess
SiteList[]=the_default_siteaccess
SiteList[]=siteaccess2
SiteList[]=siteaccess3
# ...

Next you'll have to edit the HostMatchMapItems :

[SiteAccessSettings]
HostMatchMapItems[]=www.mydomain.tld;the_default_siteaccess
HostMatchMapItems[]=user1.mydomain.tld;siteaccess1
HostMatchMapItems[]=user2.mydomain.tld;siteaccess2

And of course you should configure your DNS to redirect user1.mydomain.tld and user2.mydomain.tld to your server, and to configure your VirtualHost to do it too.

Ali Nebi

Thursday 16 June 2011 6:46:26 am

Hi, Damien.

 

Thanks for your reply.

 

Yes, this case is clear when there are few subdomains, but my point is to be more flexible. So it does not matter how many subdomain i will have, all they to point to specific siteaccess.

I'm reading now this

Regexp matching

HostMatchType=regexp
HostMatchRegexp=^(.+)\.example\.com
HostMatchRegexpItem=1

This regexp setup uses the regular expression ^(.+)\.example\.com to match anything in front of .example.com. The first match is set up to hold the siteaccess. E.g the hostname test.example.com yields the siteaccess test.

All this is ok except this line: 

HostMatchRegexpItem=1

Here i should able to set which siteaccess will be accessed when there is match with the regex in the rule above. But it seems that it is not possible without changing the php code.

 

Any ideas are welcome :)

Iguana Information Technologies, SL - http://www.iguanait.com

Marko Žmak

Thursday 16 June 2011 7:20:03 am

Try this:

HostMatchType=element
HostMatchElement=1

For all domains like *.example.com this should map to he "example" siteaccess.

Also, maybe you could get the same thing with "text" match type, but you'll have to try that.

Take a look at the docs:

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Ali Nebi

Thursday 16 June 2011 7:36:55 am

Yes, using 'element' sounds like a solution. I will try it and post here the results. 

 

Thanks.

Iguana Information Technologies, SL - http://www.iguanait.com

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu