I am trying to say if the URL only contains mysite.com and its variations, but nothing else. Variations that I can think of would be:http://, https://, www at the beginning, and a backslash at the end .com/
If it matches one of the above and contains nothing else winFormat = ':homepage'. If anything else - do else, which I have.
I am assuming this has to do with RegEx, which is not my cup of tea.
var winLoc = location.href
var winFormat
if(winLoc.indexOf('error') > -1){
var winRef = document.referrer.replace(/^.+\.edu/,'').split('/').join(':').replace(/:$/,'');
winFormat = ':error' + winRef
}
else if ('need this check - if just homepage and/or variations') {
winFormat = ':homepage'
}
else{
winFormat = winLoc.replace(/^.+\.edu/,'').split('/').join(':').replace(/:$/,'')
}