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

Author Message

Ali Nebi

Thursday 16 June 2011 5:46:01 am

Hi,

i want to set *.mydomain.tld to access one speicific site access, so every user to have his own url, for example:
https://user1.mydomain.tld  will access siteaccess where only his objects and filters will be shown.

https://user2.mydomain.tld  will access siteaccess where only his objects and filters will be shown.

Site access for user1 and user2 is the same.

Site access for www.mydomain.tld is different

Site access for admin.mydomain.tld is different.

I checked HostMapping settings, but cannot figure out how to get what i want.

 

Is this possible and how can i do that? 

Thanks in advanced.

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

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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 01:58:37
Script start
Timing: Jan 18 2025 01:58:37
Module start 'layout'
Timing: Jan 18 2025 01:58:37
Module start 'content'
Timing: Jan 18 2025 01:58:38
Module end 'content'
Timing: Jan 18 2025 01:58:38
Script end

Main resources:

Total runtime0.6834 sec
Peak memory usage4,096.0000 KB
Database Queries67

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 588.1719152.6563
Module start 'layout' 0.00600.0030 740.828139.5156
Module start 'content' 0.00900.6727 780.3438632.1953
Module end 'content' 0.68170.0016 1,412.539116.0938
Script end 0.6833  1,428.6328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4607160.0002
Check MTime0.00130.1878160.0001
Mysql Total
Database connection0.00110.158010.0011
Mysqli_queries0.601488.0098670.0090
Looping result0.00060.0944650.0000
Template Total0.654695.820.3273
Template load0.00300.432120.0015
Template processing0.651695.351020.3258
Template load and register function0.00020.033110.0002
states
state_id_array0.00090.128810.0009
state_identifier_array0.00090.130620.0004
Override
Cache load0.00250.3674640.0000
Sytem overhead
Fetch class attribute can translate value0.00050.080530.0002
Fetch class attribute name0.00130.185480.0002
XML
Image XML parsing0.00280.410630.0009
class_abstraction
Instantiating content class attribute0.00000.0027100.0000
General
dbfile0.00220.3251300.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
14content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
3content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/emphasize.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/emphasize.tplEdit templateOverride template
1content/datatype/view/ezxmltags/header.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/header.tplEdit templateOverride template
1content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 42
 Number of unique templates used: 13

Time used to render debug report: 0.0002 secs