RewriteEngine On
RewriteRule ^detail.html?id=([0-9]+)-page=([0-9]+)$ detail.php?id=$1&page=$2
I rewrite URL detail.php?id=1&page=1 to detail.html?id=1&page=1. I always get the 404 errors.
You can't match the query string using RewriteRule. The RewriteRule pattern matches against the URL-path only, excluding the query string. You would need to use a RewriteCond directive and check against %{QUERY_STRING}. (So your directive never matches and you get a 404.)
However, it doesn't look like you need to match the query as you are simply rewriting the URL's "file" extension from .html to .php. Which could be done with something like:
RewriteRule ^detail\.html$ detail.php [L]
The query string is automatically copied to the destination URL (providing you don't explicitly specify one in the substitution).
You should also escape the dot (eg. \.) in the RewriteRule pattern (which is a regular expression), otherwise it will match any character.
detail.htmltodetail.php, but your description that follows states the opposite?.phpto.htmlis not "normal". Or is this intended to be an external redirect? Which URL do you want to see in the browser's address bar - the one the user sees?