Welcome Guest, Not a member yet? Register   Sign In
How to generate domainless links or cache files
#2

[eluser]CroNiX[/eluser]
In my config I just use:
Code:
$config['base_url'] = 'http://' . $_SERVER['SERVER_NAME'] . '/';

Then all links come out fine and are generated correctly regardless of whether I'm on my dev or live server.

You could be more specific for various situations too.

Code:
$config['base_url'] = ($_SERVER['SERVER_NAME'] == 'localhost') ? 'http://localhost/somedir/somepath/' : 'http://myrealhost.com/';


Messages In This Thread
How to generate domainless links or cache files - by El Forum - 01-16-2010, 12:56 PM
How to generate domainless links or cache files - by El Forum - 01-16-2010, 04:20 PM
How to generate domainless links or cache files - by El Forum - 01-16-2010, 10:32 PM
How to generate domainless links or cache files - by El Forum - 01-17-2010, 03:02 AM
How to generate domainless links or cache files - by El Forum - 01-17-2010, 04:47 AM
How to generate domainless links or cache files - by El Forum - 01-17-2010, 04:50 AM
How to generate domainless links or cache files - by El Forum - 01-17-2010, 04:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB