Hi everyone! I am new to htaccess and need help to create something like this:

if i go to mydomain.com/category1 i must get opened mydomain.com/categories.php?cat=category1

if i go to mydomain.com/category1/02 i must get opened mydomain.com/categories.php?cat=category1?page=result2


Can you help me please?

Thanks