How to configure Joomla to open by more than one domain?

Did you followed the advices of SEO gurus, and now you have a bunch of domain names, like mydomain.com and mydomain.org, mydomain.info and mybestdomain.net, and you want to use all of them to display your sole, well built Joomla site, but dunno how? Here's the trick you need!

Point all those domain names to your account! Doing that may need a help from your hosting company, or you may be able to do it yourself. Most hosting packages have the "Addon Domains" or "Parked Domains" menuitem/applet on your hosting account to do that - find them and use them, or ask help form your hoster and/or from some experts.

Then grab your favorite tool and let's hack the configuration.php file! Oh, yea, make a backup first, just in case!

If you have Joomla 1.0.* find the following line :

            $mosConfig_live_site = 'http://www.mydomain.info'; 

And replace it with this one:

           $mosConfig_live_site = 'http://'.$_SERVER['HTTP_HOST'];

In case your Joomla is in a subdirectory you have to specify the name of the subdirectory:

           $mosConfig_live_site = 'http://'.$_SERVER['HTTP_HOST'].'/directoryname';

Note to substitute directory name with the the directory name in which Joomla resides.

That's it, enjoy the solution.

PS. And what you need to do if you have Joomla 1.5.*/1.7.*? Nothing. That one is clever enough to handle all domains pointed to your account!