The following rules should work for this. Add a new handler for it (or just
change the "default" handler to "Redirection") and use the following:

Type: Internal
Regular Expression: ^/books/(\d+)/(\d+)$
Substitution: /books/books.php?p=$1&v=$2

Type: Internal
Regex: ^/books/(\d+)$
Substitution: /books/books.php?p=$1

This assumes that both parameters will always be numeric (\d is any digit).
The issue you may encounter with using "/books/(.*)" is that .* matches
anything, including "index.php". This *may* cause weird things to happen
(but I'm not too sure)

Hope this helps!

 - Daniel


On Tue, Nov 29, 2011 at 5:23 AM, Stephen Aiena <[email protected]> wrote:

> I want urls like these:
>
> mydomain.com/books/1234
>
> mydomain.com/books/1234/567
>
> to be internally redirected to:
>
> mydomain.com/books/books.php?p=1234
>
> mydomain.com/books/books.php?p=1234&v=567
>
>
> I have tried a rule like this:
> RegX:  ^/books/(.*)
> Substitution:  /books/books.php?p=$1
>
> But I get 404 errors.
>
> Any help will be appreciated.
>
>
> --
> Stephen Aiena
> [email protected]
> 805-550-2586
> _______________________________________________
> Cherokee mailing list
> [email protected]
> http://lists.octality.com/listinfo/cherokee
>
_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee

Reply via email to