As always: Start by working out in English what you need to do.
Considering this pair:
from
/MJ/wsn/hotel-/a-great-hotel-759.html
which might mean (given that MJ and MA are literal text)
MJ/[a-z]+/[a-z]-/((?:[a-z]+-)+[a-z])-\d+\.html
to
/MA/micedirectory/10277-a-great-hotel
i.e.
/MA/something-here/something-here-$1
The two questions are:
How do you get from
wsn/hotel-
to
micedirectory
and from
759
to
10277
?
Or is it the other way around? wsn/hotel- maps to 10277, while 759 maps to micedirectory? Obviously there is no direct relationship between old and new, so it has to be spelled out explicitly-- either by a series of separate RewriteRules, or by a detour to php
In the original
/MJ/wsn/hotel-/a-great-hotel-759.html
which parts occur more than once?
/MJ/wsn/hotel-/a-great-hotel-123.html
/MJ/wsn/hotel-/a-lousy-hotel-759.html
/MJ/wsn/restaurant-/a-great-restaurant-759.html
/MJ/mch/hotel-/a-great-hotel-759.html
unfortunately my PHP is verrry limited
One r and I'd think it was a typo. Three and you're conveying a message :)
One nice thing about php is that it's got a very shallow learning curve. You don't need to learn a bunch of behind-the-scenes stuff just to get started. At the most simplistic level, you could take an existing hard-coded html document, change its extension to php, and it would continue to display just fine. Well, except that now you need a server or other php engine; you can no longer open it locally in your browser. But if you're using a CMS, you're beyond that point already.