I thought the problem was with the third rule, hence me giving it all my attention…forgetting that because i opened the floodgates for everything on the second rule it all went wrong!
Please read my previous again to see what I said about that :kaioken: ANYTHING :kaioken: atom
You did it correct in the third rule, but now you’ve made the second rule overly greedy.
Also, a page number doesn’t contain characters, does it? Tavoli/([a-zA-Z]+)/pages/color=“blue”[/color] should be Tavoli/([a-zA-Z]+)/pages/color=“blue”[/color]
Nope, the isssue is that you are using the (.*), known as the :kaioken: ANYTHING :kaioken: atom and you fell into its ugly little trap.
The problem is that (.) will match anything and everything, so it just goes on and on matching until there is nothing more to match. In this case it’s also matching the slashes further down the rewriterule, because it’s a real gready bstard and just eats everything it sees…
The solution here is to replace the (.*) with sensible atoms like (\d+) for numbers, ([a-zA-Z]+) for names, etc.
Also, why don’t you match “pages” directly? You know the second part of the URL must be “pages”, so you might as well set that.
I have no idea what the possible values are for the second part of the URI (your example indicated “Rustiche”), so I can’t give you the appropriate atom for that. If it contains only characters you should use ([a-zA-Z]+), if it contains characters and/or digits you should use ([a-zA-Z\d]+), etc.
Lastly, the [NC] is only needed when you need to match a domain name, since you have no control over how users type that (some may type example.com, others ExamPle.com, etc). However, since you control what your URLs look like it is your job to specify the correct atoms.