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