SELECT
storefronts.*
FROM
cscart_storefronts AS storefronts
WHERE
1 = 1
AND (
storefronts.url = 'diorama.fr'
OR storefronts.url = 'www.diorama.fr'
OR storefronts.url LIKE 'www_.diorama.fr'
OR storefronts.url LIKE 'diorama.fr/%'
OR storefronts.url LIKE 'www.diorama.fr/%'
OR storefronts.url LIKE 'www_.diorama.fr/%'
)
GROUP BY
storefronts.storefront_id
ORDER BY
storefronts.url = 'diorama.fr' DESC,
storefronts.url = 'www.diorama.fr' DESC,
storefronts.url LIKE 'www_.diorama.fr' DESC,
storefronts.url LIKE 'diorama.fr/%' DESC,
storefronts.url LIKE 'www.diorama.fr/%' DESC,
storefronts.url LIKE 'www_.diorama.fr/%' desc