Code: Select all
public $live_site = '';
There are literally hundreds of posts on this forum that discuss problems people have with using a non-null value for $live_site. Hundreds of posts! So, why do people use a non-null value for $live_site?
As Tim Davis explains in a video presentation (https://www.[youtube].com/watch?v=nCsfJam6DX8) a few years ago, there may have been a reason for using $live_site but no-one seems to know why it's there today.
In general, there are two main reasons for editing the file configuration.php. One of those reasons is if you're locked-out from the backend of your website and you need to enable J! debug mode; the other main reason is to verify (or change) the database credentials. In general there should be no other reason to change this file. Neither of these situations involves changing $live_site. Again, we have to ask the question, for what other reason do people edit configuration.php?
There are not many places on the internet where the $live_site setting is properly explained. The J! documentation site discusses the "need" to change $live_site:
There are a lot of assumptions here. The first assumption is that there exists a non-null value for $live_site, "typically" appearing asHave You Moved Domains?
Sometimes if you have changed domains (for example, from a localhost or test environment to the live domain), you will need to edit the value for the $live_site variable in the configuration.php file found in the root directory of your Joomla site files. The value of the variable must be manually edited, it cannot be accessed via the Global Configuration screens.
Typically, it would look like:Or, if you access your website in a sub-folder called joomla, it would be like this:Code: Select all
var $live_site = 'https://example.com';
When you move domains, this value may need updating to reflect your new domain name:Code: Select all
var $live_site = 'https://example.com/joomla';
Often there is no need to specify this variable at all. Simply leave it blank:Code: Select all
var $live_site = 'https://mynewdomain.com';
Code: Select all
var $live_site = '';
Code: Select all
var $live_site = 'https://example.com';
Code: Select all
public $live_site = '';
Thirdly, even on PC-hosted websites, there would typically be no need for a non-null value for $live_site and, therefore, no need to change this when deploying the site to a commercially-hosted environment.
In A Guided Tour of Joomla's configuration.php File, $live_site is discussed here:
I agree that it's essential to check this setting on test sites; it's essential to check this setting on all J! 4.x (or J! 3.x) websites because you will probably find that there is no need to have anything other than an non-null value for this setting. The above article was written nearly 3½ years ago and some of the advice that it contains may be outdated. In effect, $live_site may be useful in situations where the website is hosted on a badly-configured server—which is a point made in the video I mentioned earlier—but there is no apparent reason why people need to change this value.$live_site: In the newest versions this should not have a value. There may be times you do need to fill in a value. If you are redirecting a URL you need to put the actual URL to the live site on this line. Or if you are creating a copy of a site for testing and modification. For example, I have a test site at https://dashhelp.com/joomla17 which is a copy of my main site. I had to change this to line in the configuration.php file on the copy. You will get a page not found error if this is not set to 'https://yourdomain.com/directory" or in the case of a subdomain "https://subdomain.yourdomain.com" Joomla uses this URL to create relative paths. Essential to check this on test sites.
Again we return to the question, why do people change something that can't be changed under normal circumstances? What advice are people reading that instructs them to make these kinds of changes? I don't know the answers to these questions and I believe most experts would agree that there's no benefit in changing $live_site.
If someone can show us a real life example of how changing $live_site to a non-null value has made a positive improvement to their J! 4.x experience, I would be fascinated to see how this happened. My advice is to leave $live_site alone or, if it has a non-null value, change it to a null value.