
My experiment with wildcard DNS did not work for the site module. It would work great for something like emmbedding a name or word into a url and still getting to a root site.
So now I am trying a different approach.
My goal is to setup subdomains for a marketing business that sets up subsite for its affiliates.
So the main site would look like:
http://www.mainsite.com/
and the subdomains or subsites would look like:
http://myname.mainsite.com/
http://yourname.mainsite.com/
http://hisname.mainsite.com/
http://hername.mainsite.com/
I want to share everthing on the main site (modules and content) except the users, they would like the subsites to have their own user table so any leads generated are not shared between affiliates.
1. Setting up the subdomain
When I add a subdomain in cpanel it creates a subdirectory in public_html with same name as the subdomain prefix. So the location for http://myname.mainsite.com/ is in a folder called myname or at http://www.mainsite.com/myname/
2. Setting up the redirect or alias
My hosting co. dose not allow access to the httpd.conf file so I am using the .htaccess file to redirect subdomains to the main domain. in each subdomain fold I have place a .htaccess file with the following redirect:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^myname.mainsite.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.myname.mainsite.com$
RewriteRule ^(.*)$ http://www.mainsite.com/$1 [R=301,L]
This is redirecting any requests for the subdomains to the maindomain and seems to work fine.
3. New installation of XOOPS 2.2.3 upgaded to 2.2.4, added tinyd module, smartpartner module and myalbum-p module.
4. mainfile modification
I changed the line in mainfile.php from
define('XOOPS_URL', 'http://www.mainsite.com');
to
define('XOOPS_RESCUE_URL', 'http://www.mainsite.com');
5. Setting up the site module
I installed the site module into the mainsite and added a second site with the add site link under the site management tab and entered the info like this:
Site name: myname.mainsite.com
Site URL: http://myname.mainsite.com/
Theme Path: themes
Templates Path: templates_c
Upload Path: uploads
URI Pattern: http://myname.mainsite.com
Shared tables: everything except
profile_category
profile_fieldcategory
user_profile
user_profile_field
users
HHHMMMM??
I guess I am missing something or missconfiguring, I still only get the http://www.mainsite.com installation even when I enter a subdomain for a url in the browser.
Any thoughts, directions or concepts I am missing?
If I can get it working I would be happy to provide a step by step documentation for this type of installation to this thread or to a site module FAQ.
Curt