Search
 
SCRIPT & CODE EXAMPLE
 

PHP

multi domain codeigniter

$allowed_domains = array('domain1.tld', 'domain2.tld');
$default_domain  = 'domain1.tld';

if (in_array($_SERVER['HTTP_HOST'], $allowed_domains, TRUE))
{
    $domain = $_SERVER['HTTP_HOST'];
}
else
{
    $domain = $default_domain;
}

if (! empty($_SERVER['HTTPS']))
{
    $config['base_url'] = 'https://'.$domain;
}
else
{
    $config['base_url'] = 'http://'.$domain;
}
Comment

PREVIOUS NEXT
Code Example
Php :: use varable on all site pages laravel 
Php :: PHP OOP - Static Methods 
Php :: he PHP exec() function must be enabled. 
Php :: validation ignored rules 
Php :: executer page php via boutton 
Php :: yii1 anchor tag 
Php :: image downlord 
Php :: number format rupiah 
Php :: update request php-salesforce-rest-api 
Php :: IlluminateValidationRulesRequiredIf 
Php :: php only includable file 
Php :: php send to message to mobile number using springedge 
Php :: php email 
Php :: country 
Php :: modal form with php 
Php :: convert string to int php 
Php :: php send values in $_SESSION to other page 
Php :: last insert id in laravel 
Php :: how to do taxonomy filter in wordpress 
Php :: php include file from file included before 
Php :: php hash list 
Java :: java: cannot access javax.naming.Referenceable class file for javax.naming.Referenceable not found 
Java :: list java versions mac 
Java :: how to get witdth of window android 
Java :: how to set the java_home in mac 
Java :: java hashmap entryset 
Java :: processing string to int 
Java :: how to remove all special characters from a string in java 
Java :: array to map java3 
Java :: Could not initialize class org.codehaus.groovy.vmplugin.VMPluginFactory 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =