Sebastian,
You wouldn't have a pointer to the jira issue?
The problem is obvious (and exists in 7.4.0)
the problem is in PortalAliasController.cs, the logic is not correct, around line 103, you find this (BTW this is not the only problem in this code)
//remove the domain prefix ( ie. anything.domain.com = domain.com )
if (httpAlias.IndexOf(".", StringComparison.Ordinal) != -1)
{
strPortalAlias = httpAlias.Substring(httpAlias.IndexOf(".", StringComparison.Ordinal) + 1);
}
else //be sure we have a clean string (without leftovers from preceding 'if' block)
{
strPortalAlias = httpAlias;
}
//try an explicit lookup using the wildcard entry ( ie. *.domain.com )
portalAlias = GetPortalAliasLookupInternal("*." + strPortalAlias.ToLower()) ??
GetPortalAliasLookupInternal(strPortalAlias.ToLower());
if (portalAlias == null)
{
//try a lookup using "www." + raw domain
portalAlias = GetPortalAliasLookupInternal("www." + strPortalAlias.ToLower());
}
if you already have a portal with an alias of "blah.com" and then try to create another portal with "broken.blah.com" I am pretty sure that this code will consider these 2 strings to be the same and thus the error. I know that if you try this in practice, this code will not let you move forward. I think this code is trying too hard and drawing incorrect conclusions.
Just above, there is this:
//domain.com and
www.domain.com should be synonymous
if (portalAlias == null)
{
if (httpAlias.ToLower().StartsWith("www."))
{
//try alias without the "www." prefix
strPortalAlias = httpAlias.Replace("www.", "");
}
else //try the alias with the "www." prefix
{
strPortalAlias = string.Concat("www.", httpAlias);
}
IMHO This is not the best assumption. No where is it REQUIRED that
www.blah.com and blah.com be the same place. WWW is just another hostname for a domain. There is a CONVENTION where people set these up to be the same. But by no means is this required.