I have like 10 addon domains on my main website, and atm you can visit any addon (call it test1.com) website with link as test1.mainwebsite.com or www.mainwebsite.com/test1
How can I block this access to addons?
I have tried this, but this block only www.mainwebsite.com/test1 way.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?mainwebsite.com$ [NC]
RewriteCond %{REQUEST_URI} ^/google.com/(.*)$ [OR]
RewriteCond %{REQUEST_URI} ^/something.net/(.*)$
RewriteRule ^(.*)$ - [L,R=404]