I am trying to write code that contains a URL that has three parts (www). (domainname). (com) and completely crop the first part.
So far I have this code that checks to see if I have “www” or “dev” on the left side, log in and install siteDomainName = removecharsCGI.SERVER_NAME,1,2);
if (numHostParts eq 3 and listfindnocase('www,dev',left(CGI.SERVER_NAME,3)) eq 0) {
siteDomainName = removecharsCGI.SERVER_NAME,1,2);
The problem with the code above is that only 2 characters are deleted, where I need to delete ALL characters before numHostParts eq 2or at least the first "."
Another example might be:
akjnakdn.example.com I need code to remove the first part of the dotted URL (akjnakdn.)
This code will help some of the requests I have on the site to stop crushing because they are linked by C # URL #, and when # URL # is fake, I get an error cform query returned zero recordsthat causes my contact forms to stop working.
source
share