Allow URL access, disallow subdirectory access

I have a second website stored in the root of my main website. It’s a subdomain with its own URL

I want users to access the second website via a URL eg

 www.mysecondwebsite.com

but not via the first website eg

 www.myfirstwebsite.com/mysecondwebsite

Can this be done via .htaccess? If so where do I put the .htaccess file: in the root of the main site or the root of the subdirectory/domain?

Thank you.


Source: .htaccess

Leave a Reply