|
Joomla Multiple Domain Names |
|
Multiple domain names pointed to the same joomla site? The conventional wisdom on search engine behavior is that you should force the domain name to a single main url. On apache servers this can be accomplished a couple ways. The easiest is through mod_rewrite rules that are placed in a plain text file named .htaccess (note the .) Joomla comes wih an htaccess.txt file that can and should be renamed to .htaccess once you have finished installation if you are using apache. Once it is renamed you can add rewrite rules to the file to help eliminate any duplicate site problems with search engines. The first rewrite should redirect traffic to either yourdomainname.com or www.yourdomainname.com. I prefer the www.domainname.com. Add the following lines to your .htaccess right after Rewrite Engine On
RewriteCond %{HTTP_HOST} !^www\.domainname\.com$ [NC] RewriteRule ^(.*)$ http://www.domainname.com/$1 [R=301,L]
to force the use of the www. It is possible to to create a mod_rewrite endless loop. If you test your site and there is a problem you can comment out the lines by adding the # character at the begining of the line.
Now lets take care of any other domain names that are pointing to the same site. Some webhosting panels refer to them as add on domains. The placement of these rules is critical to proper function. We must rewrite the domain name before our previous rewrite. This means that the following rule needs to be placed after the Rewrite Engine On but before the above rules.
RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.?)yourduplicatesite.com$ RewriteRule ^(.*)$ http://www.yourmainsite.com/$1 [R=301,L] |
|
|
|
|
|
<< Start < Prev 1 2 Next > End >>
|
|
Page 1 of 2 |