When you want to link to the URL that will show page "43" of your site, look in the title table of your database for the page title of page 43 and then construct the href for the URL by using the page number and that page title (normalised to lower case, with spaces and other punctuation replaced with hyphens).
When the user clicks on href="/43-what-is-the-capital-of-Peru" the browser sends a request to the server. This RewriteRule will call your script...
RewriteRule ^([0-9]+)-(.*) /index.php?id=$1&text=$2 [L]
Your script first needs to check (by looking in the database table) that the ID is valid. If not, send a 404 HEADER and a human readable page of html and text with an error message. Next, check that the requested page title is correct for this page ID. If the title is not valid for this ID, send a 301 redirect to the correct URL. If the ID and title are both valid, pull the page content from the content table of the database, then build the HTML page and send it to the browser.
At no point do you "redirect" to a parameter-based URL. Instead you should internally "rewrite" requests to be internally served by a parameter based internal filepath.
If someone does request
or for that matter
then you should redirect the user to
to prevent duplicate content issues.
This RewriteRule is the reverse of the first example, but needs an additional bit of code to prevent an infinite redirect-rewrite loop. This extra line of code is a RewriteCond that checks THE_REQUEST to ensure that only parameters in an external request are redirected, not those from a previous internal rewrite.