login about faq

I have try a lot of times to create a second site in hostmonster via add-on domain, but the system inevitably create a sub-domain for me, which is not what I want, I don't want search engine bot like google or yahoo to crawl my subdomain site, only the main site

asked Oct 19 '10 at 03:03

guru4us's gravatar image

guru4us
1623


In most of shared hosting enviornment, if an add-on domain is created, the sub domain have to be created as well. In order to avoid users to browse your site via your sub-domain name, you can restrict or redirect the request from subdomain to your domain name via modifying the .htaccess file

Here is an example of configuration for the django application deployment in hostmonster. For instance your main domain name is www.main-domain.com and the add-on domain name is www.addon-domain.com

RewriteCond %{HTTP_HOST} ^addon-domain.main-domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.addon-domain.main-domain.com$
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ http://www.addon-domain.com/ [R=301,L]

RewriteRule ^(media.*)$ /$1 [QSA,L,PT]
RewriteCond %{REQUEST_FILENAME} !(guru4us.fcgi)

RewriteRule ^(.*)$ django_fcgi.fcgi/$1 [QSA,L]
RewriteCond %{HTTP_HOST} ^main-domain.com$
RewriteCond %{REQUEST_URI} ^/$

The first block tells if any url directly pointing the addon-domain.main-domain.com will be redirected to addon-domain.com, The rest of blocks are handling django fastcgi.

The detail can be referenced from here

answered Oct 19 '10 at 03:13

guru4us's gravatar image

guru4us
1623

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×4
×1

Asked: Oct 19 '10 at 03:03

Seen: 864 times

Last updated: Oct 19 '10 at 03:13

powered by OSQA