Dynamic 313's rule should do the trick, here is how mod_rewrite works
1. User send request to pretty URL (
www.site.com/pages/1/)
2. Apache find matching rule, if one matches it
internally rewrites (
www.site.com/page.php?id=1)
3. Apache sends output from ugly URL to browser without mentioning where on the server the code came from.
In short, you access the pretty URL and the server runs the "ugly" URL that it is written to.
Therefore when you directly type in the pretty URL it will do what you want, and unless you specifically restrict access to the ugly URL, that will also work.