Once I’ve figured something out or get the needed help on the forums, I turn my Q’s into A’s. Lisa suggested I make this one into a WIKI entry.
Caution: I’m not an expert and I actually can be vague.
This applies to those who either MUST or CHOOSE to use separate directories for multiple sites. Reason? Unable to use MOD REWRITE for subdomains, OR Host separates sites via different directories.
Example Server Directories: (structure varies with hosts)
Main Site - /home/you/domains/primary-site.com/html/(EE Installed Here)
Sub 1 - /home/you/domains/blog2.primary-site.com/html/(WEBLOG Blog2 here)
Sub 2 - /home/you/domains/forum.primary-site.com/html/(Forum Here)
Diff Site - /home/you/domains/diff-site.net/html/(Different Site, Same Host/Account)
Needed Files: (Copied from main EE install dir. NOT SYSTEM)
Path.php, Index.php, (from Main Site root) and .htaccess
Control Panel Stuff:
Create WEBLOG’s and Template Groups accordingly. Don’t have to unless you just like keeping things nice and separated.
Path.php:
*** If your system folder is in /home/you/domains/primary-site.com/html/
*** and the new site is in /home/you/domains/some-different-dir.com/html/
*** Then you’d use the following system path.
<?php
$system_path = "../../primary-site.com/html/system/";
$template_group = "blog2_tpl_grp";
$template = "index"; *** as in site/index
$site_url = "http://blog2.primary-site.com/";
$site_index = "index.php"; *** Optional
$site_404 = "";
$global_vars = array(); // This array must be associative
?>
Index.php - DO NOT EDIT.
.htaccess - for a WEBLOG
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
.htaccess - for a FORUM
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/forum_tpl_grp/$1 [L]
The reason for the difference is the page links. Without the forum_tpl_grp in there, when you click on a forum topic you’ll get a “File Not Found”. I don’t understand it. I just know it’s a pain.
If doing a forum subdomain in this way, you MUST call the FORUM through normal templates by creating a template called ‘forum’, name of tem[plate is never seen so you can name it ‘hoo-hah’ if you want.
Add this and NOTHING else to the template you create:
{exp:forum board="forum_trigger_word"}
Then you’ll call it in the forum’s Path.php:
$template_group = "tpl_grp_forum_tpl_is_in";
$template = "forum";
In the Control Panel WEBLOG and FORUM managment, keep the SITE Url’s as whatever.com/ or forum.whatever.com/ without the index.php/tpl_grp otherwise it will show up in the Address Bar. Hence the .htaccess. This tutorial presumes you like pretty URL’s :)
Lastly, you’ll need to go here:
http://expressionengine.com/wiki/Multiple_Domain_Login/
And follow all the steps. Make sure to read it all, don’t forget to empty the Cookie Domain field and turn on Cookies Only in the Session Preferences - Both.
You know you have the forum wrong when you click on a topic and it says page not found. That means your .htaccess is wrong. OR you try to login on forum.site.com and it doesn’t indicate you’ve properly logged in. Double check the config.php and make sure you got it right.
If you require that people who sign up at the different sites be automatically assigned a usergroup, you MUST use MSM. MSM will remain a separate product from EE even as 2.0 evolves. Meaning, it won’t be a moot purchase in 6 months.
Category:Subdomains
Category:Multiple Sites
Category:Discussion Forum
