This site uses cookies to deliver our services and to show you relevant ads and job listings.
By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service.
Your use of Stack Overflow’s Products and Services, including the Stack Overflow Network, is subject to these policies and terms.

Join us in building a kind, collaborative learning community via our updated
Code of Conduct.

I want to basically extract out the domains and put them on a ban list in .htaccess

I want to remove everything that is after .com and I want to remove everything that is in the prefix like http:// or https:// or http://www. or 'https://www.' and sometimes some websites are like www23. or any other sub-domain.