or you can redirect all www. requests to non-www. requests. this is also better because it means that only the non-www. will be indexed by search engines, not both non-www. and www. sites.
To redirect from a www. prefixed page on your website to a non-www. prefixed page simply add this to or create a .htaccess file in the root of your Joomla! installation if you on a server with Apache installed.
Not using Joomla! SEO/SEF:Create/add this code to a .htaccess file in the joomla! root folder.
- Code: Select all
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*) http://example.com/$1 [L,R=301]
Using Joomla! SEO/SEF:Add the following code to the end of your .htaccess file.
- Code: Select all
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*) http://example.com/$1 [L,R=301]
PLEASE NOTE: For this to fully work your $mos_live_site must have the non-www. address. To change it, (download the configuration.php to your computer if you've updated it online) and look for $mosConfig_live_site at the start of the line (line 44 by default). Change the address between the quotes and upload this file.