Situation

At the Joomla/Mambo administration backend, when you click Insert Image on the content editor, a blank window appears. This has something to do with the javascript in relation with the way you typed your URL and the Live Site setting on you Global Configuration. You have to add or remove the ‘www.’ prefix on your address depending on the setting on your Live Site setting on you Global Configuration at the administration backend.

Temporary and inefficient work-around

Go to your administration backend and go to Site|Global Configuration then Server tab and check your Live Site configuration. If your Live Site settting is like:

http://extratopics.com (no ‘www.’ prefix)

then you also have to remove the ‘www’ prefix when you go to the administration page like:

http://extratopics.com/administrator/ (also has no ‘www.’ prefix)

for the Insert Image to work properly.

But if you do have a ‘www.’ prefix on your Live Site setting then you should also add the prefix on the admin address so you could insert images properly.

What others suggest

Most users suggest that you add a ‘www.’ prefix on your Live Site setting. This is NOT a good idea because you’re simply switching the problem to the other. Meaning, adding a ‘www.’ prefix to the live site setting would also require you to add a prefix everytime and vise versa.

How about the front end?

We have been focusing on the backend and the Insert Image issue. But you must remember that the Live Site setting affects your Joomla/Mambo site globally, that is, incuding the front end. Adding a ‘www.’ prefix on the Live Site setting would also require all your visitors to add a ‘www.’ prefix when they type your address. If they don’t add a prefix, some of your javascript based modules and components might not work properly. You forgot about this didn’t you? Even I myself have neglected this.

Now also if you remove the prefix on the Live Site settings, all visitors must also remove the prefix for some javascripts to work. Now we can’t tell all visitors what to type on the address can we?

Proper solution to all of these

Open the configuration.php file found in your Joomla/Mambo installation root folder and find:

$mosConfig_live_site = ‘http://yourdomain.com’; (with or without ‘www.’)

Replace with:

$mosConfig_live_site = ‘http://’ . $_SERVER["SERVER_NAME"];

That’s it! This is a very simple fix and is very flexible. The Live Site setting will automatically change depending on what the admin or visitor type on the address bar without worrying whether they use a ‘www.’ prefix or not at the front end or at the back end.


Tell a Friend

See also: