remove keys and keep only values from url params

You are getting a 404 error because the redirected URL subdomain.example.com/3/lorem-ipsum doesn't exist on your server. To fix this, you need to map this new URL format to its original location subdomain.example.com?id=3&s=lorem-ipsum .

RewriteEngine ON
RewriteCond %{THE_REQUEST} \?id=([^&]*)&s=([^\s&]*) [NC]
RewriteRule ^ /%1/%2? [R=301,L]
#map new URL to the old one
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/(.+)$ /?id=$1&s=$2 [L]