Change site url in 5.5.1

Permalink 2 users found helpful
Did this process change for 5.5.1? I don't see the

define('BASE_URL', '');

in the /config/site.php file.

View Replies:
dancer replied on at Permalink Reply
Hi there,
I was wondering the same thing and came across your post.

I have moved my website from: to

Now the CSS won't load, I am assuming it's because of the change in URL but I can't find the "define ('BASE_URL'....), in the site.php. Why is this? I assume I can just add it?

gdecris replied on at Permalink Reply
I have the same issue? Has anyone found a resolution.

I tried adding the define('BASE_URL', ....) but to no avail.
I also checked the 'Config' table and I do not see an option for it there.

Where could it be hiding :)

Thanks in advance
ScottC replied on at Permalink Reply
It is actually inferred from the $_SERVER array

It has actually been optional for quite a while, my part-time employer has been leaving it out for quite a while, they are running mostly

To answer your question about where these are defined, when concrete5 is ran it invokes concrete/dispatcher.php through a require statement in your index.php file.

So in there it loads up a file located at concrete/config/base.php and the actual code is
# These items should be set by site.php in config/ but if they're not that means we're installing and we need something there
/* https patch applied here */
if (!defined('BASE_URL')) { 
   if(isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on')) {
      define('BASE_URL', 'https://' . $_SERVER['HTTP_HOST']);
   } else {
      define('BASE_URL', 'http://' . $_SERVER['HTTP_HOST']);
if (!defined('DIR_REL')) {
   $uri = substr($_SERVER['SCRIPT_NAME'], 0, stripos($_SERVER['SCRIPT_NAME'], DISPATCHER_FILENAME) - 1);
   define('DIR_REL', $uri);

I guess the thinking is that if it is good enough to get an install to load then it might as well not be there. Less code is better code :)
jasteele12 replied on at Permalink Reply
Hmm, I would say in the case of c5 "less executed code is better code" :)