Welcome Guest, Not a member yet? Register   Sign In
Is valid this base_url setup??
#1

I had been reading this:
PHP Code:
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|    http://example.com/
|
| WARNING: You MUST set this value!
|
| If it is not set, then CodeIgniter will try guess the protocol and path
| your installation, but due to security concerns the hostname will be set
| to $_SERVER['SERVER_ADDR'] if available, or localhost otherwise.
| The auto-detection mechanism exists only for convenience during
| development and MUST NOT be used in production!
|
| If you need to allow multiple domains, remember that this file is still
| a PHP script and you can easily do that on your own.
|
*/
$config['base_url'] = ''

And I want to have no problem with security , so on my production application I want to setup correctly the base_url config. With other projects I had done  there was no problem because I only need to use one domain... But now the things changes. I am doing something like a multidomain system... and a thing I am thinking is:


PHP Code:
$config['base_url']    = strtolower(substr($_SERVER["SERVER_PROTOCOL"],0,strpos$_SERVER["SERVER_PROTOCOL"],'/'))).'://'.$_SERVER['HTTP_HOST']; 

Could be that correct?? 
Thank you.
Reply


Messages In This Thread
Is valid this base_url setup?? - by eloyucu - 02-18-2016, 02:10 AM
RE: Is valid this base_url setup?? - by Narf - 02-18-2016, 02:42 AM
RE: Is valid this base_url setup?? - by freddy - 02-18-2016, 06:26 PM
RE: Is valid this base_url setup?? - by Krycek - 02-18-2016, 07:03 AM
RE: Is valid this base_url setup?? - by rsilva6 - 02-18-2016, 11:36 AM
RE: Is valid this base_url setup?? - by Diederik - 02-19-2016, 01:30 AM
RE: Is valid this base_url setup?? - by cartalot - 02-19-2016, 12:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB