I've been looking around on the internet and playing around a bit and managed to get this working perfectly:
This takes a url of the form sites/Some-Country/Some-City/Some-Site/siteid and re writes to the dynamic page sites/?sid=siteid
RewriteRule /sites/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([0-9]+) /sites/index.php?sid=$4
But the next part I'm having some trouble with: I need a url of the form
to be re written to the same as earlier but with those extra url parameters. I've had no success yet and any help would be appreciated!
Also, while I'm about it, I need what I've currently got at /([A-Za-z0-9-]+) to also match foreign characters (such as ã) - how do I do this?