Currently $mosConfig_live_site gets picked up in the basic SEF as base href.
It's in includes\frontend.php and may be in other code as well.
if ( isset($mosConfig_sef) && $mosConfig_sef ) {
echo "
\r\n";
}
The problem with this is that it forces sites into chosing to be either www or NO-www but not giving the option to be both.
Where Apache is set up for a domain with an alias to handle the url as either
http://domain.com or
http://www.domain.com, using $mosConfig_live_site is effectively hardcoding the url into being one or the other.
Now, the www subdomain is deprecated (and the sooner everyone drops it the better!) but many visitors hold with the old ways and look for a domain under the www subdomain. Until everyone stops doing this, sites have to make allowances for it. But, a visitor should be able to navigate the entire site following the same path.
If $mosConfig_live_site is set to domain.com and a visitor comes in through
http://www.domain.com, dynamic links will throw them onto the NO-www path. Ok, they are still on the site and seeing what they need. Search engines, however, see this as moving from one site to another and will penalise sites for this.
I know that the argument is that everyone should just set $mosConfig_live_site to use www - but I have an issue with using something that is deprecated and unneccessary.
A simple fix is to use $_SERVER['HTTP_HOST']
So, my request is this : could $mosConfig_live_site be changed/removed and $_SERVER['HTTP_HOST'] used instead?
I am not a coder, so I may be simplifying the change needed. But after spending hours reading the Joomla code to find why my site is moving between www and NO-www, getting extra hits on Apache for its troubles, and getting penalised by Google for it, this is what I have pinpointed as being the problem.
Can this be fixed for the new release please?