To www. or not to www. ?
To www. or to not www. ?
That's not really the question here...
We can have long, very long, discussions about the use of www. in the URL (http://www.example.com) or not (http://example.com). Or even about using www.www. (http://www.www.example.com). But that discussion is beyond this blog post.
In Joomla 1.0.15 you'll have to choose for one type of URL in the configuration.php file.
Because if you don't and the $mosConfig_live_site in configuration.php differs from the real URL, you might get in trouble:
- the WYSIWYG-editor might behave badly; with empty editor screens and you not being able to edit as result;
- some browsers will make you login twice because the cookie/session differs from the actual URL!
The point of this blog post is to get all your domain traffic to the same URL.
So that you can welcome all yes www.-ers and no www.-ers at your site...
To force all traffic to www.example.com (at an Apache webserver that supports .htaccess and mod_rewrite!) add the following code to your .htaccess file:
RewriteCond %{HTTP_HOST} ^yoursite\.com [NC]
RewriteRule (.*) http://www.yoursite.com/$1 [R=301,L]
If you are unable to make changes to the .htaccess file then consider using an SEO canonicalisation plugin instead.