I’m looking for the simplest way to check if the user is on the normal domain (domain.com) or is on a subdomain et.domain.com and display content based on that. If it matters I’m trying to do that on shopify.
I’m looking for the simplest way to check if the user is on the normal domain (domain.com) or is on a subdomain et.domain.com and display content based on that. If it matters I’m trying to do that on shopify.
2
Answers
You can split the url with dot(.) and check the length. This will only work for .com url.
Note: This will not work for domains like google.co.in
You can actually use regex method.