如何限制对主域的访问并允许插件域

I have domain abc.com and there is many domains under this domain as addon domains like:

  • abc1.com
  • abc2.com
  • abc3.com

I want to restrict access to abc.com using IP, so only known IP's I have can access it. and in the same time keep abc1.com, abc2.com, abc3.com running for public.

I want to do this using .htaccess on a LAMP server I have. How can i do that?

This is will stop access to subdomains which are the addon domains I have. I still need addon domains able to be accessed by public.