forked from Qortal/qortal
When specifying a domain without a subdomain, add a www. version automatically.
Longer term we will probably need a 301 redirect in these cases for SEO purposes, but this is a nice convenience feature for now.
This commit is contained in:
parent
0328007345
commit
60f96d15bd
@ -504,14 +504,15 @@ public class Settings {
|
|||||||
return this.domainMapLoggingEnabled;
|
return this.domainMapLoggingEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<DomainMap> getDomainMap() {
|
|
||||||
return this.domainMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, String> getSimpleDomainMap() {
|
public Map<String, String> getSimpleDomainMap() {
|
||||||
HashMap<String, String> map = new HashMap<>();
|
HashMap<String, String> map = new HashMap<>();
|
||||||
for (DomainMap dMap : this.domainMap) {
|
for (DomainMap dMap : this.domainMap) {
|
||||||
map.put(dMap.getDomain(), dMap.getName());
|
map.put(dMap.getDomain(), dMap.getName());
|
||||||
|
|
||||||
|
// If the domain doesn't include a subdomain then add a www. alternative
|
||||||
|
if (dMap.getDomain().chars().filter(c -> c == '.').count() == 1) {
|
||||||
|
map.put("www.".concat(dMap.getDomain()), dMap.getName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user