Welcome Guest, Not a member yet? Register   Sign In
Addon domain to display class content
#1

[eluser]mthomas9[/eluser]
Hi. Just about to wrap up my first codeigniter project. Just have to get past this last hurdle....

I have an addon domain on top of codeignter. File structure looks like this:

- application
- config
- controllers
- addondomain (class)
- errors
- etc...
- system
- cache
- codeigniter
- etc...
- addondomain
- index.php

Right now.. if if visit addondomain.com I see the content of the index.php file.

What I would like it to do is instead call the class 'addondomain' and display its content.

I have tried the ideas posted to the thread here: http://ellislab.com/forums/viewthread/123442/#653735 with no luck.

What do you think? Is this possible? Thanks in advance...
#2

[eluser]mthomas9[/eluser]
I figured it out.. Not sure if its the right way, but it does the trick:

I copied the index.php file from the primary domain to the addondomain subfolder. Changed the $system_path and $application_folder to point back to the primary domains files

$system_path = "../system";
$application_folder = "../application";


Then in the application/config/routes.php file I replaced

$route['default_controller'] = "home";

with

switch($_SERVER['HTTP_HOST'])
{
case 'primary.com':
case 'www.primary.com':
$route['default_controller'] = "home";
break;

case 'addondomain.com':
case 'www.addondomain.com':
$route['default_controller'] = "addondomain";
break;

default:
$route['default_controller'] = "home";
break;
}


And that seemed to do the trick.




Theme © iAndrew 2016 - Forum software by © MyBB