Many Subdomains with single Havalite CMS

HavaLite CMS

A new liteweight Content Management System (CMS)

Many Subdomains with single Havalite CMS

In Version 1.4.1 and above of Havalite CMS the user can run and manage many subdomains with only a single installation of Havalite system. All we need is a new SQLite database beside our main database in folder "data" and to edit the line in "config.php" file which defines your new added subdomains. To do such, please follow next steps:

1. Create Subdomains

Mostly all providers offer their own customers the ability to create many subdomains beside the main domain. The user can figure this out in the the customers login of his/her provider. If not, than he/she should contact their provider and ask about this service, but normaly this service is included. To create a subdomain is very easy (See image), one thing we shouldn't forget: Never relink the new subdomain to another target such as folder or another url adresse. The url of the subdomain must stay the same as our main domain, other wise it wont work.

http://mydomain.com  and  http://www.mydomain.de
/     These 2 domains are main domain
http://subdomain.mydomain.de
/     and this one is the url of our new subdomain

2. SQLite Database

Now, when we open the folder "data" in havalite, we'll find our main SQLite database called "havalite.db3". We can make a new copy of it and call it "subdomain_havalite.db3". If you need a new clear database, you can download Havalite CMS again, open the zip file and take "havalite.db3" from it, rename it to "subdomain_havalite.db3". We have now 2 databases in folder "data":

havalite.db3
subdomain_havalite.db3

3. Editing config.php

In the same folder as before we also find the file "config.php". We open it with any html or text editor (such as Notepad.exe). The line to edit can be seen at the begining of the document: 

$db_path = 'havalite.db3'; // This is the main database
$db_sub = ''; // databases for subdomains

We dont need to change the first line if we don't want to rename our main database name.

In the second line we add the name of the subdomain and the database for it as follows: 

$db_sub = 'subdomain=subdomain_havalite.db3';

Thats it!

Now after loading the new database and the edited config.php file to our server. Havalite realize automatically the subdomain from url and uses the database for it.

Also when we create many subdomains, we do the same as before than add all subdomain names and the databases names in one line as follow: 

$db_sub = 'sub1=sub1.db3,sub2=sub2.db3,sub3=sub3.db3';

Hava fun with Havalite CMS wink

comments powered by Disqus

0 Comments

    Leave a Reply

    Contact Info

    Phone: +49 941 26175

    Address: Ayman Teryaki,
    Prüfeninger Str. 48,
    93047 Regensburg, Germany

    Want more info - go to our contact page or visit Google+

    Social

    Stay up to date. Subscribe via RSS, Facebook, Twitter or Email

    Recent Comments