Home > Web > prevent people from using the addon domain as a subdomain of your primary domain.

prevent people from using the addon domain as a subdomain of your primary domain.

September 22nd, 2009 Leave a comment Go to comments

To prevent people from using the addon domain as a subdomain of your primary domain, just put the following code into 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]
Categories: Web Tags: , ,
  1. December 2nd, 2009 at 17:55 | #1

    works for me

  1. No trackbacks yet.