mod_rewrite multiple parameters with regex (.*)


I have a url like the following:

As you can see there is Unicode string up there. I use the following directive in my htaccess:

RewriteRule ^cat/(.*)/page/([0-9]*)/$ cat.php?cat=$1&page=$2 [L,NC]

The problem here is the regex engine parses the url above and it sets all the ????/page/2/ as the first parameter while I only want the Unicode string as my first parameter and the integer as the second.

How can that be done? Is there a better way for finding Unicode characters other than (.*)?

That's a bit odd -- it should not behave like that -- must be Unicode messing the whole thing.

In any case -- use this instead -- it is more precise:

RewriteRule ^cat/([^/]+)/page/([0-9]+)/$ cat.php?cat=$1&page=$2 [L,NC]

You can replace [0-9] by \d -- does exactly the same and is shorter.

By : LazyOne

This video can help you solving your question :)
By: admin