Newbie Question- Urgent help required

bestofanil

Registered
Nov 21, 2010
2
0
51
Hi,
I have little knowledge of cpanel. I use to host my domain and also setup my add-on domain.
My Issue-
say
Main domain= maindomain.com
addonDomain= addondomain.com

After adding addon Domain, cpanel create a sub-domain of main domain like
sub.maindomain.com and it links to addondomain.com.

The problem is the sub.maindomain.com is indexed in Google and it open the addon site & its content with same url(sub.maindomain.com).

Now, How can I prevent this sub.maindomain.com from indexing in Google. Since it is not hosted on any CMS like wordpress/joomla, where & what changing I can do in robots.txt file to prevent indexing.
Or is there any other solution.

Thanks
 

bestofanil

Registered
Nov 21, 2010
2
0
51
After lots of Google search I got my answer at - /http://www.fayazmiraz.com/remove-subdomain-access-from-addon-domain/

I edit my .htaccess file like this

Earlier its was like
# mod_rewrite in use

RewriteEngine On
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.addondomain.com [NC]
RewriteRule ^(.*)$ http://addondomain.com/$1 [L,R=301]

and now modified it like this
# mod_rewrite in use

RewriteEngine on
RewriteCond %{HTTP_HOST} ^sub.maindomain.com [NC]
RewriteRule ^(.*)$ http://addondomain.com/$1 [L,R=301]
RewriteEngine On
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.addondomain.com [NC]
RewriteRule ^(.*)$ http://addondomain.com/$1 [L,R=301]
I am using Joomla cms. Now next way is to remove my indexed url from google.

Thanks