<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Life, Tech, Vet and time..... &#187; Domains</title>
	<atom:link href="http://www.charltonfamily.com.au/benjic/tag/domains/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.charltonfamily.com.au/benjic</link>
	<description>This blog covers anything I feel the need to blog about</description>
	<lastBuildDate>Sat, 18 Apr 2009 05:12:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>2 Domains with 1 Joomla Installation done right</title>
		<link>http://www.charltonfamily.com.au/benjic/2009/02/2-domains-with-1-joomla-installation-done-right/</link>
		<comments>http://www.charltonfamily.com.au/benjic/2009/02/2-domains-with-1-joomla-installation-done-right/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 15:26:46 +0000</pubDate>
		<dc:creator>benjiC</dc:creator>
				<category><![CDATA[Website Design]]></category>
		<category><![CDATA[configuration php]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Domains]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[iframes]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[request uri]]></category>
		<category><![CDATA[rewrite rules]]></category>
		<category><![CDATA[virtual host]]></category>
		<category><![CDATA[webhost]]></category>

		<guid isPermaLink="false">http://www.charltonfamily.com.au/benjic/?p=18</guid>
		<description><![CDATA[You can no longer use the Global configuration in the Joomla admin as it will change these settings back.]]></description>
			<content:encoded><![CDATA[<!-- This is a HTML comment, it will not display in any page. Feel free to remove this comment if it cause any inconvenient to you.
	Thanks for using digg digg, please visit http://www.mkyong.com/blog/digg-digg-wordpress-plugin for any comments and ideas, 
	
    Author : Yong Mook Kim
    Website : http://www.mkyong.com
	--><div style='float:left'><table> <td><iframe src='http://digg.com/api/diggthis.php?w=new&amp;u=http://www.charltonfamily.com.au/benjic/2009/02/2-domains-with-1-joomla-installation-done-right/&amp;t=2+Domains+with+1+Joomla+Installation+done+right&amp;s=icon' height='16' width='16' frameborder='0' scrolling='no'></iframe></td></table></div><p>I have had 3 domain names for a while now representing 2 seperate business&#8217;s.  My problem has been I didnt have the time to write content for 2 seperate Joomla installations.  It was far easier to have 1 installation and set up some iframes for the 2 business domains.  The problem I discovered was that Google does like iframes and does not index them effectively. (it records the hidden address not that of the iframe, which makes sense)</p>
<p>So I decided to work out a way to have 2 domains (with seperate home pages accessing the 1 installation of Joomla.    Now I am guessing 2 installations of Joomla accessing the 1 database would work as well&#8230;but that wasnt what I wanted and has its own problems.</p>
<p>So to start with point the domains at the same host with the same document root.   This is done easily with cpanel.  Use add domain and just enter the doc root.  This sets up the virtual host.</p>
<p>Obviously you need to ensure your dns points at the same IP&#8230;I like using zoneedit.  Its free for less than 5 domains and for more well&#8230;its not that expensive.  My webhost did not allow DNS editting so because I use a unique mail server I needed a service like ZoneEdit.</p>
<p>Okay so your DNS is setup&#8230;and you have it pointing at the same Virtual host.</p>
<p>Now Joomla..you are going to need to edit 2 things</p>
<ol>
<li>.htaccess</li>
<li>configuration.php</li>
</ol>
<p>In .htaccess you need to turn modrewrite on.  Most people using SEO will have already done this.  at the bottom you need to add the following</p>
<pre style="padding-left: 30px;">Rewritecond %{HTTP_HOST} ^www.domain2.com$ [OR]
Rewritecond %{HTTP_HOST} ^domain2.com$
Rewriterule ^$ "index.php?content=eg,blog=76 ...." [R=301,L]</pre>
<p>This basically takes anyone coming to you site via the 2nd domain and rewrites the request uri to the homepage of your 2nd site.  Obviously yuo should replace the index.php part with the correct path to your second home page&#8230;.</p>
<p>So cool now when we access via domain2 we end up at the right page.  BUT all the links on the page will reference domain1 &#8211; not great for coherance.</p>
<p>So we need to make the site name dynamic and the site address as well, so the seo works.</p>
<p>So open the configuration.php in your favourite file editor (if your using cpanel use the &#8220;File Manager&#8221; select the file in the doc root and choose &#8220;Code Edit&#8221;).</p>
<p>Find the variable</p>
<pre style="padding-left: 30px;">$mosConfig_live_site
change the line to read
$mosConfig_live_site = 'http://'.$_SERVER['HTTP_HOST'];</pre>
<p>Find the variable</p>
<pre style="padding-left: 30px;">$mosConfig_sitename
change the line to
IF($_SERVER['HTTP_HOST']=='www.domain2.com.au'){$mosConfig_sitename
="Title of Domain 2 Site";}else{$mosConfig_sitename ="Title of Domain
 1 Site";};</pre>
<p>You can use a similar line to the above to vary any variable based on host.</p>
<p>Now change the file permissions of configuration.php to 444.  You can no longer use the Global config in the Joomla admin as it will change these settings back.</p>
<p>Check it all out you should be good to go.</p>
<p>Let me know if it works for you.</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?sitename=Life%2C%20Tech%2C%20Vet%20and%20time.....&amp;siteurl=http%3A%2F%2Fwww.charltonfamily.com.au%2Fbenjic%2F&amp;linkname=2%20Domains%20with%201%20Joomla%20Installation%20done%20right&amp;linkurl=http%3A%2F%2Fwww.charltonfamily.com.au%2Fbenjic%2F2009%2F02%2F2-domains-with-1-joomla-installation-done-right%2F" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.addtoany.com/share_save?sitename=Life%2C%20Tech%2C%20Vet%20and%20time.....&amp;siteurl=http%3A%2F%2Fwww.charltonfamily.com.au%2Fbenjic%2F&amp;linkname=2%20Domains%20with%201%20Joomla%20Installation%20done%20right&amp;linkurl=http%3A%2F%2Fwww.charltonfamily.com.au%2Fbenjic%2F2009%2F02%2F2-domains-with-1-joomla-installation-done-right%2F');"><img src="http://www.charltonfamily.com.au/benjic/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Save/Bookmark"/></a>

	</p>]]></content:encoded>
			<wfw:commentRss>http://www.charltonfamily.com.au/benjic/2009/02/2-domains-with-1-joomla-installation-done-right/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
