Addon Domain Problem

Permalink
I have an addon domain (new-site.com) that is not redirecting properly. I placed the code suggested in one post (see "Redirect code" below) to try and fix the problem but it did not work. I received an error that said "Page not found" and had a missing icon for Concrete5 in the upper left corner of the window.

Since this addon domain is in a folder off the root of the primary domain, hwo do I configure the site.php file to point to this location?

Example:
Primary site is host-site.com
Addon site is new-site.com

in the "public_html" folder of host-site.com
is a folder "new-site". When a user browses to new-site.com, it should go to that folder and pull up the website.

I tried modifying the /home/myhost/public_html/host-site/new-site/config/site.php file several different ways, but can't seem to get it to work. Either I get a blank screen, or the error mentioned above. If I browse tohttp://www.host-site.com/new-site,... everything works. I don't want the person browsing to know it is hosted under host-site.com.

Obviously, I'm lost ... anyone have an idea?



--- Redirtect Code -------------------------------------
<?php
define('REDIRECT_TO_BASE_URL', false);
?>


--- Original .htaccess -------------------------------------
RewriteEngine on

RewriteCond %{HTTP_HOST} ^netsite.net$ [OR]
RewriteCond %{HTTP_HOST} ^www.newsite.net$
RewriteRule ^/?$ "http\:\/\/www\.main\-site\.com\/newsite" [R=301,L]


--- Edited .htaccess -------------------------------------
# Use PHP5 as default
AddHandler application/x-httpd-php5 .php
RewriteEngine On
RewriteCond %{HTTP_HOST} ^newsite.host-sitee.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.newsite.host-site.com$ [OR]
RewriteCond %{REQUEST_URI} ^/$


--- Edited site.php -------------------------------------
<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'hostsite_cfv05');
define('DB_PASSWORD', '03ZCRCqB1E');
define('DB_DATABASE', 'hostsite_cfv05');
define('REDIRECT_TO_BASE_URL', false);
define('BASE_URL', 'http://www.host-site.com');
('newsite' == '') ? define('DIR_REL', '') : define('DIR_REL', '/newsite');
define('PASSWORD_SALT', 'X3dnikuehddlpxJ02GV8hksiud7HYg0B476Rz1rE2MSaMZVGnZaWbSpWmEvyee7');
?>

lab3
 
lab3 replied on at Permalink Reply
lab3
Ok ... after tinkering with the site.php file, I have been able to get the site to redirect properly.

However, when I go into edit the site, as soon as I click the edit page button, the C5 toolbar disappears.

Any idea why this is happening?




BTW ... my site.php now looks like:

<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'hostite_cfv05');
define('DB_PASSWORD', '04ZDVTmM9Q');
define('DB_DATABASE', 'hostsite_cfv05');
define('REDIRECT_TO_BASE_URL', false);
define('BASE_URL', 'http://www.hostsite.com/newsite');
define('PASSWORD_SALT', 'VnGEwudjcliosK25RM2dlkFL4bDsklB951Rz1rE2MSaMZVGnZaWbSpWmEvyee7');
?>
<?php define('PERMISSIONS_MODEL', 'advanced'); ?>
lab3 replied on at Permalink Reply
lab3
Anyone have an idea?
frz replied on at Permalink Reply
frz
does it work better if you try to edit from the source domain instead of the add on? That would be my guess..
lab3 replied on at Permalink Reply
lab3
I looked at the admin login for the source domain and can;t find a way to edit the addon domain pages. Maybe thast was/is my first mistake. When I install concrete5, I presumed that I had to have a copy for each addon domain. I currently have concrete5 installed in the host domain as well as a separate copy of concrete5 in each addon domaina. I was wondering after reading several posts in the forum if a multidomain configuration was possible.

I'll look at the forums again for a multisite setup adn see what I can find.

If you have any quick pointers, I'd appreciate that too!
ScottC replied on at Permalink Reply
ScottC
Yeah you "need" a different db for each install, or at least db prefixed specific tables if you want to get into that. I certainly don't.

You can in fact share assets between concrete5 installs, but actual pages live in the db as db records that go through the model, get selected through the controller and passed through the view before being displayed as html.
lab3 replied on at Permalink Reply
lab3
When I installed C5 from the scripts provided by my host, they automatically installed the C5 into the addon domains folder along with a separate db for this addon domain as well. Do I change the .htaccess or site.php file (or both) to point the addon domain(s) to the C5 code base on the source domain so I'm using one code base for my source and addon domains?

Do you knwo of any forum entries in the past that I can refer to to get me pointed in the right direction?
frz replied on at Permalink Reply
frz
is the add-on domain supposed to be a completely separate site, or is it supposed to be something that is another name for the same site?

i'm not sure I know that yet, and i think this thread is getting too technical with out that base understanding.

If it's two sites, yeah - you just need to concrete5 installs, separate databases, codebase etc.. If you're doing this on a larger scale and you want to centralize your concrete5 install for easy maintenance reasons, we have a whitepaper available to folks in our hosting partner program that talks about how we did just that on getConcrete5.com.
http://www.concrete5.org/help/support_and_partners/c5hosting_partne...

I'm not sure that's what you're really shooting for however.. Can you give us the end goal?
lab3 replied on at Permalink Reply
lab3
I want to be able to use C5 to manage these sites. I'm NOT trying to recreate the getConcrete5.com design since I have only a small number (less than 5) domains I'm working with. So I'm ok with managing 5 different code bases.

I have one hosting account that allows for addon domains. Currently I have the following:

http://www.hostdomain.com
http://www.addondomain-a.com
http://www.addondomain-b.com
http://www.addondomain-c.com

In public_html on this site, i have the following folders:

public_html\addondomain-a
public_html\addondomain-b
public_html\addondomain-c

C5 is installed in the domain and each of the addon domains. So I have a separate codebase for each addon.

I need to be able to have people to browse the internet to each of the addon domains and get to the specific site without displaying the hostdomain site in the URL.

I want each of the addon domains to be able to manage the content once I have setup the sites (they are non-profit sites and personal sites).

Clear as mud? :-)
frz replied on at Permalink Reply
frz
yeah that helps..

well it sounds like these sites are all somewhat similar or at least need to share assets..

what i might do in your shoes is actually just use one concrete5 install and database for /all/ of them. i would make the base level pages off of home be:
site1
site2
site3
etc..

and then I would do the whole site specific tree under that. I would then make a different theme for each site, and I would do a mod-rewrite/htaccess trick to get each domain to point to the right spot on the single concrete5 install and treat it as if it were home.. this would give your site visitors the experience you're looking for, the only caveat is you'd probably have to pick one domain to use for edit mode on all of the sites.

does this approach make sense to anyone but me? seems a bit tricky to setup, but once you have it it's simple to manage - unlike hacking half the app/database in one spot vs. another...

also, i'm not sure you'd have to pay your host to do the addon domain thing they're doing this way..
lab3 replied on at Permalink Reply
lab3
I tried this and it is giving me a "Page not found error". Looking at the URL, it is doubling the addon on domain in the URL.

Instead of:
http://www.hostdomain.com/addondomain/index.php?cID=1...

I'm getting:
http://www.hostdomain.com/addondomain/addondomain/index.php?cID=1...

If I edit out the extra "addondomain/" the toolbat comes up.

Do you think this is from an .htaccess file, or a site.php problem?
lab3 replied on at Permalink Reply
lab3
Here are the contents of these two files:

.htaccess
----------------------------------------------------
# Use PHP5 as default
AddHandler application/x-httpd-php5 .php

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /addondomain/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_METHOD} !^(GET|PUT)
RewriteRule .* - [F]

RewriteRule ^addondomain/(.*)$ index.php/$1 [L]
</IfModule>




site.php
----------------------------------------------------
<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'hostdoma_cfv05');
define('DB_PASSWORD', 'xxxxxxxxxxx');
define('DB_DATABASE', 'hostdoma_cfv05');
define('REDIRECT_TO_BASE_URL', false);
define('BASE_URL', 'http://www.hostdomain.com/addondomain');
define('PASSWORD_SALT', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx7');
define('PERMISSIONS_MODEL', 'advanced');
?>

Any help/direction is GREATLY appreciated!
sporkles replied on at Permalink Reply
sporkles
Please help. Addon domains don't show up. My setup is pretty much identical to lab3's.
ryan replied on at Permalink Reply
ryan
a) You want to run multiple c5 sites on the same server, share the same concrete5 code base, but the sites are completely separate.

b) You want to manage multiple sites from one concrete5 install by mapping domains to folders of a c5 site.

c) You want to manage one site, but have it display for multiple domains.
- define('REDIRECT_TO_BASE_URL',false); will do that one.

Which one are you looking for.
Ryan
sporkles replied on at Permalink Reply
sporkles
I think I would like for the sites to be completely separate for different clients. It sounded like B was more complicated.

How would I share the same code base? Do I need to do this?

Right now I have 3 c5 installs,
1. at root (but I'm not using yet)
2. /client1 (that is live - but not working so I just recreated the site in HTML until this is resolved -yikes.) I have to go to mydomain.com/client1/index.php to view it because client1.com doesn't work.
3. /client2 installed but not active (that has not been designed yet.)

Thanks, Ryan for any direction you can give.

Michelle
ryan replied on at Permalink Reply
ryan
There are two ways:
symlinks, are easiest, For my development environment I just keep the "concrete" folder from the latest version of concrete in a common location & then in each concrete site that I setup, I remove the concrete folder & then:
ln -s /common-location/concrete5.3.2/concrete concrete


Second way is with apache, in your virtualhost container, you can add an Alias & include_path that points to your common install.

http://httpd.apache.org/docs/1.3/mod/mod_alias.html#alias...

php_admin_value include_path '/common-location/concrete5.3.2/concrete'

Ryan
sporkles replied on at Permalink Reply
sporkles
Where do I put the symlink code? What is "-s"?

Thank you!
frz replied on at Permalink Reply
frz
this stuff starts to get reasonably complicated, particularly if you're not a sys-admin. There's a white paper in our hosting partner program that details this a bit more, and we'll also offer anyone a 6th site free if you host 5 sites with us. I'm afraid providing systems support for a centralized install approach to concrete5 for free in forums is beyond the scope of what we can deliver. ;(
harlankoehn replied on at Permalink Reply
I understand that the question of multiple Concrete5 sites on a single hosting package is being regarded as "too complicated for the forum". I guess I'd like to have a little clarification though.

In most of the questions and answers it was always assumed that some amount codebase was to be shared across multiple sites. I specifically don't care to do that. I want to host three totally different Concrete5 websites on one hosting package, all for the same client. It might be simpler in one respect to share the codebase but I'm wondering how possible or difficult it is to simply host three entirely different Concrete5 installs on a single server/hosting package. Did I read somewhere that certain Concrete5 folders need to be in the root of the primary domain for some reason?

Is there an FAQ somewhere for this question? Is this question outside the scope of the forum?
frz replied on at Permalink Reply
frz
if you're talking about running three unique feeling sites from one concrete5 instance and database, you should check this out:
http://www.concrete5.org/marketplace/addons/domain_mapper/...
harlankoehn replied on at Permalink Reply
That's specifically what I'm not talking about. I think that question has nearly been answered in this post.

The question is, can I run three different Concrete5 instances (and 3 different databases) on one hosting package? My hosting provider supports this but does the code in Concrete5 support this?
frz replied on at Permalink Reply
frz
no
cleverington replied on at Permalink Reply
cleverington
I think!

I have one hosting package that supports sub-domains and multiple databases.

1. create a sub-domain
2. create a database to be used with that sub-domain
3. copy the C5 files into the folder belonging to the sub domain
4. configure C5 at the address of the sub-domain.

hafc.hawkwellfc.com
u9pumas.hawkwellfc.com
u9leopards.hawkwellfc.com
etc. etc.
ryan replied on at Permalink Reply
ryan
If the hosting account is intended to host multiple web sites then you just install separate installs of c5.

But if you're working with one a hosting account that's intended to have one site and additional add-on domains then separate c5 instances won't really work out cleanly.
harlankoehn replied on at Permalink Reply
Ryan,

Is the reason for this something to do with php.ini? Does each "website" essentially need to have it's own PHP and Apache config files?
harlankoehn replied on at Permalink Reply
I made a phone call to my web hosting company and verified that my hosting package supports multiple domains/websites (not subdomains) and that each domain/website can have its own php.ini file in its "root". I'm wondering if that's enough to make it work?
ryan replied on at Permalink Reply
ryan
Concrete doesn't need anything more than any other web site. Basically if you can get your hosting setup with:

http://www.siteA.com
http://www.siteB.com
http://www.siteC.com

and each of those sites are pointing towards their own folder in your hosting setup, you're good to go.

You'd just install concrete in each one of those - nothing special about it.

You'd also want to give each concrete install it's own mysql database.

You shouldn't need to set any site specific php.ini directives

Start by getting up your sites with a test file in each without concrete in the picture, then install concrete in each site.
harlankoehn replied on at Permalink Reply
Thank you very much. I'll give it a try and see how it works. Somewhere I got the impression that each CMS install needs to have a php.ini file in it's root and that many hosting companies don't support this. I'm starting to wonder if that isn't a Drupal or Joomla thing that I read somewhere and just assumed it would apply to Concrete5 as well. I'll try to post back the results here when I'm done unless someone can verify that they already operate sites this way.

Thanks