Virtukon,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<script>
var template = ["file.com", "data.com", "day.net", "files.com"],
urls = ["http://data.com/hdstyyd", "https://day.net/67545455555", "https://file.com/mnffd2764qgd8", "http://files.com/urz0m3zse53k/myfile.rar.html"];
function getIndex(url) {
var i = -1;
template.some(function(a, b) {
return ~url.indexOf(a) && (i = b)
});
return i
}
urls.sort(function(a, b) {
a = getIndex(a);
b = getIndex(b);
return a - b
});
document.write("<strong>" + urls.join(" ") + "</strong>");
</script><br>
<strong>
https://file.com/mnffd2764qgd8
http://data.com/hdstyyd
https://day.net/67545455555
http://files.com/urz0m3zse53k/myfile.rar.html
</strong>
</body>
</html>