Get 'domainname' and search for it in the db

Author Message

Mark Overduin

Friday 22 August 2003 5:33:30 am

How do I get the domainname the site is running on?

So, if the url is "http://www.mydomain.com/index.php/www/content/view/...", how do I get 'mydomain.com' (without 'www' plz) out of it?

The next thing I'd like to do, is to search a specific folder (sites) for a folder named 'mydomain.com' (and get the id of that folder).

The reason I want to do this, is because I'm building one site, that can be used by multiple sites, but with other id's (so the content is entirely different).
I have a folder (sites) that contains other folders (mydomain.com, mycompany.net, amioriginalorwhat.com, etc...).

Result: If the domainname for instance is 'mycompany.net', the script looks for that domainname and shows all the content for 'mycompany.net'.

Hope anyone can help me!

Thanx in advance, Mark

Mark Overduin

Monday 25 August 2003 12:31:44 am

Anyone?

Bjørn Kaarstein

Monday 25 August 2003 2:46:59 am

In site.ini, or site.ini.append.php you can specify your URL's

[SiteAccessSettings]
CheckValidity=false
MatchOrder=host
HostMatchMapItems[]=www.mydomain.com;mydesign
HostMatchMapItems[]=mydomain.com;mydesign
HostMatchMapItems[]=admin.mydomain.com;admin

Here you can see that www.mydomain.com and mydomain.com will be set to use the "mydesign" siteaccess.

This will need to be set up in your apache and DNS records aswell.

Regards Bjørn

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