HostMonster Web Hosting Help

Restrict subdomain access to addon domains


Each Addon Domain requires a subdomain. Using mod_rewrite you can stop people from being able to use the addon domain as a subdomain of the primary domain

Preventing use of the Subdomain

Put this in the .htaccess file located at the subdomains folder, changing the subdomain, and

RewriteEngine On
        RewriteCond %{HTTP_HOST} ^$ [OR]
        RewriteCond %{HTTP_HOST} ^$ [OR]
        RewriteCond %{HTTP_HOST} ^$
        RewriteCond %{REQUEST_URI} ^/$
        RewriteRule ^(.*)$ [R=301,L]
Knowledgebase Article 167,846 views bookmark tags: addon domain htaccess (updated 1176 days ago)

Was this resource helpful?

Did this resolve your issue?

Please add any other comments or suggestions about this content:

Recommended Help Content

I do not want to see How do I do that? (updated 1166 days ago)
Knowledgebase Article 126,454 views tags: accessible addon directory domain folders hidden htaccess inaccessible primary secondary

Can I make subdomains for my addon domains on the account? (updated 1174 days ago)
Knowledgebase Article 161,267 views tags: add addon dns domain park subdomain

How do I make a sub directory (or sub folder) act as the public_html for your main domain? (updated 15 days ago)
Knowledgebase Article 590,367 views tags: Drupal domain htaccess joomla wordpress

Related Help Content

What is an Addon domain? (updated 427 days ago)
Knowledgebase Article 153,731 views tags: addon domain

How do I FTP to my addon domains without interfering with my main account. (updated 1174 days ago)
Knowledgebase Article 201,130 views tags: addon domain ftp

What is the difference between parked domains and addon domains? (updated 1174 days ago)
Knowledgebase Article 132,934 views tags: add addon domain park parked

How do I setup an addon domain or parked domain in my hosting account? (updated 15 days ago)
Knowledgebase Article 376,743 views tags: addon domains parked

I have setup a pointed/addon domain, where should I upload the files for this domain? (updated 1176 days ago)
Knowledgebase Article 136,476 views tags: addon domain pointed

How to run CGI scripts for Addon domains. (updated 1174 days ago)
Knowledgebase Article 88,399 views tags: cgi htaccess

Can I setup an email account for Addon or Parked domains? (updated 1177 days ago)
Knowledgebase Article 124,655 views tags: addon domain email pointed

Can I have multiple domains pointing to my site or to a directory on my site? (updated 94 days ago)
Knowledgebase Article 216,829 views tags: domain domains