Knowledgebase

Restrict subdomain access to addon domains

Problem:

How do I stop people from being able to use the addon domain as a subdomain of the primary domain?

Solution:

Put this in the .htaccess file located at the subdomains folder
RewriteEngine On
RewriteCond %{HTTP_HOST} ^subdomain.primarydomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.subdomain.primarydomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^addondomain.com$
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ http://www.addondomain.com/ [R=301,L]


Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
Hotlink Protection (Views: 1231)
Redirect (Views: 1316)

Client Login

Email

Password

Remember Me