Home Tutorials How to redirect always to 'www' (avoid editor problems)
How to redirect always to 'www' (avoid editor problems)

path-logo.pngVery often people have issues with opening the editor popups which will return empty or with errors. Depending on the editor, this problem may occur when trying to edit the html, insert tables or perform a similar function that requires javascript.

The issue is most often caused by your livesite settings in the configuration file:

 $mosConfig_live_site = 'http://mydomain.com';
When you log into your site, you must log in from the exact livesite. if you don't the javascript in your editor will not work. So the first step is to change the configuration file to:
$mosConfig_live_site = 'http://www.mydomain.com';
After which we will force all browser access from http://mydomain.com to http://www.mydomain.com.

Open your .htaccess file which is located in the root folder of your joomla-installation (make sure it is renamed from htaccess.txt to .htaccess!) than at the end of the file add:

########## Begin Redirecting non-www request to www
#
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite.com [NC]
RewriteRule (.*) http://www.mysite.com/$1 [L,R=301]
#
########## End
Redirecting non-www request to www

replace the mydomain.com with your actual site and you are done!