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

[eluser]Jamie Rumbelow[/eluser]
As far as dynamic URLs go, I use a little bit of code that works on all platforms and allows me to have the full domain/hostname in my base URL. It looks something like this:

Code:
$url = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http");
$url .= "://".$_SERVER['HTTP_HOST'];
$url .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);

$config['base_url']    = $url;


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