Is there any way to
www.domain.com/new-mexico/albuquerque/businessname-513526.html
is replaced with:
businessname.domain.com/new-mexico/albuquerque/businessname-513526.html
This means "www" will be replaced by the business name. This should be simple but I don't know how to implement it.
Sounds like you may need to use
str_replace