Announcement: New module MultiDomains

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Andiministrator

Announcement: New module MultiDomains

Post by Andiministrator »

Within the last two weeks I developed a new module for CMSms: MultiDomains
Download: http://dev.cmsmadesimple.org/project/files/852

This module provides support for the use of different domains with one installation of CMSms. You can assign each domain to a page (or page-tree). The module will redirect the domain automatically.
Furthermore the module supports 301 redirects of moved pages (or old urls) to new pages (well, that what the module MovedPages) does.
Last but not least it has a small statistic, how many visitors each domain has.
And - it has support for a development server, so you dont need to change your database before you transfer it.

Ok, here are some guidelines, how to use the module:
1. Enable mod_rewrite
- Open the file "config.php" (in the CMSms root directory) and set the parameter "url_rewriting" to "mod_rewrite" (if it is not already done)
- Create a new file named ".htaccess" (if it not already exists) in the CMSms root directory with (at least) the following content:

Code: Select all

# .htaccess for CMS made simple
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_METHOD} !POST$
RewriteRule ^(.*) %{REQUEST_URI}/ [NE,R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
# EOF
2. Insert the module placeholder in your template
Insert the following placeholder at the beginning of each page template:

Code: Select all

{cms_module module='MultiDomains'}
The placeholder MUST BE AT THE BEGINNING of your template (before "{process_pagedata}")!
3. Add your domains in the module backend
Go the the module backend (Extensions/MultiDomains) and add your domains and its associated pages.

If you get problems with using this module, please send me a problem description.

Happy MultiDomaining!
Aureli
Forum Members
Forum Members
Posts: 74
Joined: Wed Aug 06, 2008 10:48 pm

Re: Announcement: New module MultiDomains

Post by Aureli »

Excellent!
I was just having a look at this post to see how could I use the same content to create a "normal" site and a smaller scale mobile site. (http://forum.cmsmadesimple.org/index.php?topic=25495.0).

So could this module do this: have www.mysite.com and use the same content to create a mobile site in  mobile.mysite.com?

Gotta give it a go!
Thanks.

A.
jchelpdeskwv
Forum Members
Forum Members
Posts: 53
Joined: Tue Nov 10, 2009 6:47 pm

Re: Announcement: New module MultiDomains

Post by jchelpdeskwv »

Thank you very much!
Andiministrator

Re: Announcement: New module MultiDomains

Post by Andiministrator »

Aureli wrote: So could this module do this: have www.mysite.com and use the same content to create a mobile site in  mobile.mysite.com?
The module needs a different page(-tree) for every domain. E.g.:

Code: Select all

Startpage  --> Standard Domain (e.g. my-website.com)
  |--> Pagetree 1 --> domain-1.com
  |        |--> Page 1
  |        `--> Page 2
  |--> Pagetree 2 --> domain-2.com
  |         |--> Page 4
  |...
So, if you work with a different content tree for your mobile site, try this module.

Best regards
Andi
Andiministrator

Re: Announcement: New module MultiDomains

Post by Andiministrator »

Dr.CSS wrote: NOTE: This module will most likely NOT be supported by Devs, so you will have to ask the developer for support...
If you see any conflict with the core modules, please give me a note ...
Andiministrator

Re: Announcement: New module MultiDomains

Post by Andiministrator »

I've just released Version 1.3 of MultiDomains.
Download: http://dev.cmsmadesimple.org/project/files/852

There is no smarty placeholder needed anymore in a page template, the module works now using events.

I'm using the event "ContentPostRender" (ContentPreCompile was not working). If you know a better (earlier) event for MultiDomains, please tell me ...
NaN

Re: Announcement: New module MultiDomains

Post by NaN »

Andiministrator wrote:
I'm using the event "ContentPostRender" (ContentPreCompile was not working). If you know a better (earlier) event for MultiDomains, please tell me ...
Did you try SmartyPreCompile or TemplatePreCompile?



EDIT:

All the PreCompile stuff seems not to work with cached pages. Because if a page is cached it actually won't be really compiled anymore (since it actually already is). Only the cached php scripts will be processed. And so no PreCompile events are triggered.
So ContentPostRender might be the only event that is always triggered.
Unfortunately there is no "OnPageAccess" event that is triggered before or after the content object has been loaded.
Last edited by NaN on Sun Jun 06, 2010 10:44 pm, edited 1 time in total.
Andiministrator

Re: Announcement: New module MultiDomains

Post by Andiministrator »

Thanks for your interesting reply.
So for now I'll use the event "ContentPostRender".
An "OnPageAccess" would be cool ...
djkirstyjay
Forum Members
Forum Members
Posts: 206
Joined: Tue Oct 25, 2005 4:50 pm

Re: Announcement: New module MultiDomains

Post by djkirstyjay »

Can you tell me how this module actually works?

It's very interesting.... I have actually been hosting many sites on one CMS installation for a while, but have had to use domain redirects. I'm really interested in this, but cannot find a good explanation of what it does.

Thanks in advance :)
Andiministrator

Re: Announcement: New module MultiDomains

Post by Andiministrator »

Did you have a look in the module help?
djkirstyjay
Forum Members
Forum Members
Posts: 206
Joined: Tue Oct 25, 2005 4:50 pm

Re: Announcement: New module MultiDomains

Post by djkirstyjay »

Yes I did... it says "This module allows to use multiple domains with CMS made simple. You can assign domain names to existing pages."... but what I would like is an explanation of how.

Do I assign a domain to the same nameservers as my CMS installation and it will detect the domain name and open a specific part of the CMS...? If not, how does it work?

:)
Andiministrator

Re: Announcement: New module MultiDomains

Post by Andiministrator »

djkirstyjay wrote:Do I assign a domain to the same nameservers as my CMS installation and it will detect the domain name and open a specific part of the CMS...?
Yes, exactly.
Here the way how to implement the module:

1. Enable mod_rewrite
- Open the file "config.php" (in the CMSms root directory) and set the parameter "url_rewriting" to "mod_rewrite" (if it is not already done)
- Create a new file named ".htaccess" (if it not already exists) in the CMSms root directory with (at least) the following content:

Code: Select all

# .htaccess for CMS made simple
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_METHOD} !POST$
RewriteRule ^(.*) %{REQUEST_URI}/ [NE,R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
# EOF
2. Add your domains in the module backend
Go the the module backend (Extensions/MultiDomains) and add your domains and its associated pages.
Last edited by Andiministrator on Mon Aug 02, 2010 10:59 am, edited 1 time in total.
djkirstyjay
Forum Members
Forum Members
Posts: 206
Joined: Tue Oct 25, 2005 4:50 pm

Re: Announcement: New module MultiDomains

Post by djkirstyjay »

Andiministrator wrote:
djkirstyjay wrote:Do I assign a domain to the same nameservers as my CMS installation and it will detect the domain name and open a specific part of the CMS...?
Yes, exactly.
Fantastic mod. :)

I have actually been doing this for about two years using the masked redirects from my server, however this actually makes it soooo much better.

Now the only thing that remains to be done in order to make the CMS truly multi-user/domain, is to have it so that you can assign individual users permissions to access module admin for only their site... for example, if you have the guestbook installed, then a user would see all the comments for their guestbook and not all guestbooks, or just manage their own forms in formbuilder, or galleries in album.

I'm not asking you to do it, just thinking out loud :D I have tried to find a way myself for this... maybe with multiple installations of the same module... one for each domain...
Last edited by djkirstyjay on Mon Aug 02, 2010 11:30 am, edited 1 time in total.
djkirstyjay
Forum Members
Forum Members
Posts: 206
Joined: Tue Oct 25, 2005 4:50 pm

Re: Announcement: New module MultiDomains

Post by djkirstyjay »

Right... I have installed your mod (latest version - 1.3.1) on CMSMS 1.8.1.

I have followed the instructions above.

My site tree is as follows :

1 - clubactivo.com (page seperator)
1.1 - contact
1.2 - home (default page)
1.3 - etc....

2. - gol-mundial.com
2.1 - home (default page)
2.2 - etc...

I have edited my .htaccess file as you said. I just copied and pasted your code into it.

I have edited my config.php as you said, and changed it to mod_rewrite.

When I try to access the site, clubactivo.com, I get the following error :
The page isn't redirecting properly          

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

   *   This problem can sometimes be caused by disabling or refusing to accept
         cookies.
The site only works when I make the site inactive in the MultiDomains control panel

Update* : It's now working when I remove the www prefix option in the domain options. Why is this a problem, and what is the option there for?

Although I have solved the issue, I'm still posting this post in case anyone else has a problem getting it working and it can help them solve it too :)
djkirstyjay
Forum Members
Forum Members
Posts: 206
Joined: Tue Oct 25, 2005 4:50 pm

Re: Announcement: New module MultiDomains

Post by djkirstyjay »

I have set up gol-mundial.co.uk and added it to multidomains, as in my previous post. The domain has propagated, but it's still only going to clubactivo.com. It's quite urgent that I get this sorted, as people need to start booking courses today.

I thought I had it sorted, so any help is greatly appreciated!!!

All my server, CMS and module info is on my previous post. I can't retype at present, as I'm on my mobile.

Thanks in advance!
Locked

Return to “Modules/Add-Ons”