Why no "www" in url?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am
Location: Western Australia

Why no "www" in url?

Post by jasnick »

CMSMS 1.9.3

I've just noticed that when I type an address of a site done with CMSMS in the address bar, it starts off with http://www.site.com/ then as I click on the various pages in the navigation, the "www" is no longer there.

Does this matter?
beherenow_uk
Forum Members
Forum Members
Posts: 103
Joined: Fri Nov 28, 2008 11:26 am

Re: Why no "www" in url?

Post by beherenow_uk »

jasnick wrote:CMSMS 1.9.3

I've just noticed that when I type an address of a site done with CMSMS in the address bar, it starts off with http://www.site.com/ then as I click on the various pages in the navigation, the "www" is no longer there.

Does this matter?
It doesn't particularly matter if you have it or not, but the control for this is in your base URL in your config.php file in the root of your website folder. lines 83-86 show this:
#Document root as seen from the webserver. No slash at the end
#If page is requested with https use https as root url
#e.g. http://blah.com
$config['root_url'] = 'http://www.yourwebsite.com';
So just change that root URL to whatever you need it to be. :)
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: Why no "www" in url?

Post by Wishbone »

If you don't like that, or you have multiple domains pointing to the same install and you don't want this, I suppose you could set:

Code: Select all

$config['root_url'] = 'http://' . $_SERVER['SERVER_NAME'];
..so that it will take the URL of whatever you gave it.

I'm a supporter of http://no-www.org/, so I add something to my .htaccess to remove all www's completely.
jasnick
Power Poster
Power Poster
Posts: 695
Joined: Sat Jan 15, 2011 8:36 am
Location: Western Australia

Re: Why no "www" in url?

Post by jasnick »

Thanks, beherenow_uk, for the explanation. I will have a look at that.

Wishbone,
at first I thought that was a joke site name.... ;D
My pre-CMSMS sites all have the emails set up to allow www and no-www but I didn't know it could apply to domain addresses as well.
Post Reply

Return to “CMSMS Core”