Page 1 of 1

Why no "www" in url?

Posted: Tue Mar 08, 2011 1:55 pm
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?

Re: Why no "www" in url?

Posted: Tue Mar 08, 2011 2:51 pm
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. :)

Re: Why no "www" in url?

Posted: Tue Mar 08, 2011 2:56 pm
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.

Re: Why no "www" in url?

Posted: Wed Mar 09, 2011 12:16 am
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.