Welcome Guest, Not a member yet? Register   Sign In
controller as a subdomain
#8

[eluser]John_Betong[/eluser]
[quote author="x386" date="1224079576"]Is this possible to access controllers not only by site.com/controller and have something like this: controller.site.com?
Thanks![/quote]
 
 
I use a sub-domain on this site http://iching.justjoolz.com and for me Smile it was not easy to setup.
 
In my http://localhost I have a path to c:/www/iching/index.php and online I have http://iching.justjoolz.com/index.php
 

index.php - common to both sites
Code:
...
   define('LOCALHOST', 'localhost' === $_SERVER['SERVER_NAME']);
   ...
   ...
  $system_folder = "ci_system"; // Default - ver: 1.63
  if (LOCALHOST) {
    $system_folder = "../ci_system";
  }
  
  // http://iching.justjoolz.com
  if (strpos($_SERVER['SERVER_NAME'], 'justjoolz')) {
    $system_folder = "../ci_system"; // ver: 1.63
  }
  ...
  ...
  $application_folder = 'iching'; // http://iching.justjoolz.com/iching
  if (LOCALHOST) {
    $application_folder = '../iching';
  }

  // http://iching.johns-jokes.com
  if (strpos($_SERVER['SERVER_NAME'], 'jokes')) {
    $application_folder = 'http://iching.johns-jokes.com'; // online setting
  }
  // echo '$application_folder --> '  .$application_folder ; die;
  ...
  ...
 
Needless to say my config.php was setup with trial and error, if you want a copy let me know.
 
 


Messages In This Thread
controller as a subdomain - by El Forum - 10-15-2008, 03:06 AM
controller as a subdomain - by El Forum - 10-15-2008, 04:15 AM
controller as a subdomain - by El Forum - 10-15-2008, 04:31 AM
controller as a subdomain - by El Forum - 10-15-2008, 05:26 AM
controller as a subdomain - by El Forum - 10-15-2008, 06:36 AM
controller as a subdomain - by El Forum - 10-15-2008, 02:50 PM
controller as a subdomain - by El Forum - 10-15-2008, 02:52 PM
controller as a subdomain - by El Forum - 10-15-2008, 06:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB